1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Fix tuptoaster bugs induced by making bytea toastable. Durn thing was

trying to toast tuples inserted into toast tables!  Fix is two-pronged:
first, ensure all columns of a toast table are marked attstorage='p',
and second, alter the target chunk size so that it's less than the
threshold for trying to toast a tuple.  (Code tried to do that but the
expression was wrong.)  A few cosmetic cleanups in tuptoaster too.
NOTE: initdb forced due to change in toaster chunk-size.
This commit is contained in:
Tom Lane
2000-08-04 04:16:17 +00:00
parent ed9ca68758
commit dd8ad64118
5 changed files with 107 additions and 69 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.83 2000/08/03 19:18:54 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.84 2000/08/04 04:16:06 tgl Exp $
*
*
* INTERFACE ROUTINES
@ -1362,7 +1362,7 @@ heap_insert(Relation relation, HeapTuple tup)
* ----------
*/
if (HeapTupleHasExtended(tup) ||
(MAXALIGN(tup->t_len) > (MaxTupleSize / 4)))
(MAXALIGN(tup->t_len) > TOAST_TUPLE_THRESHOLD))
heap_tuple_toast_attrs(relation, tup, NULL);
#endif
@ -1621,13 +1621,15 @@ l2:
#ifdef TUPLE_TOASTER_ACTIVE
/* ----------
* If this relation is enabled for toasting, let the toaster
* delete not any longer needed entries and create new ones to
* make the new tuple fit again.
* delete any no-longer-needed entries and create new ones to
* make the new tuple fit again. Also, if there are already-
* toasted values from some other relation, the toaster must
* fix them.
* ----------
*/
if (HeapTupleHasExtended(&oldtup) ||
HeapTupleHasExtended(newtup) ||
(MAXALIGN(newtup->t_len) > (MaxTupleSize / 4)))
HeapTupleHasExtended(newtup) ||
(MAXALIGN(newtup->t_len) > TOAST_TUPLE_THRESHOLD))
heap_tuple_toast_attrs(relation, newtup, &oldtup);
#endif