summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-08-04 04:16:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-08-04 04:16:17 +0000
commitdd8ad6411846f8ca609a824f3b515260be1f0ca1 (patch)
treef538d86b9b91cb91534ab6085878b03cbe914869 /src/backend/access/heap/heapam.c
parented9ca687582caa88f31c4b273b9fd4eb5743cf41 (diff)
downloadpostgresql-dd8ad6411846f8ca609a824f3b515260be1f0ca1.tar.gz
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.
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r--src/backend/access/heap/heapam.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 1e22c03046..d5f36e4e4d 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -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