diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-02 21:14:11 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-02 21:14:11 +0000 |
commit | c3110e49b1601941e0173e8d75378f943b4ca6fd (patch) | |
tree | 3cb0a453fe9e193f38e8796e9281c8274bc96f28 /src/backend/access/gin/ginfast.c | |
parent | ac317a8474e7c2e2c67ee37f8cb1a6511eb662d9 (diff) | |
download | postgresql-c3110e49b1601941e0173e8d75378f943b4ca6fd.tar.gz postgresql-c3110e49b1601941e0173e8d75378f943b4ca6fd.zip |
Make sure that GIN fast-insert and regular code paths enforce the same
tuple size limit. Improve the error message for index-tuple-too-large
so that it includes the actual size, the limit, and the index name.
Sync with the btree occurrences of the same error.
Back-patch to 8.4 because it appears that the out-of-sync problem
is occurring in the field.
Teodor and Tom
Diffstat (limited to 'src/backend/access/gin/ginfast.c')
-rw-r--r-- | src/backend/access/gin/ginfast.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c index 557817dfeb9..fb6710e7e49 100644 --- a/src/backend/access/gin/ginfast.c +++ b/src/backend/access/gin/ginfast.c @@ -11,7 +11,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/gin/ginfast.c,v 1.3.2.1 2009/09/15 20:31:35 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/gin/ginfast.c,v 1.3.2.2 2009/10/02 21:14:11 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,7 +20,6 @@ #include "access/genam.h" #include "access/gin.h" -#include "access/tuptoaster.h" #include "catalog/index.h" #include "commands/vacuum.h" #include "miscadmin.h" @@ -465,16 +464,10 @@ ginHeapTupleFastCollect(Relation index, GinState *ginstate, */ for (i = 0; i < nentries; i++) { - int32 tupsize; - - collector->tuples[collector->ntuples + i] = GinFormTuple(ginstate, attnum, entries[i], NULL, 0); + collector->tuples[collector->ntuples + i] = + GinFormTuple(index, ginstate, attnum, entries[i], NULL, 0, true); collector->tuples[collector->ntuples + i]->t_tid = *item; - tupsize = IndexTupleSize(collector->tuples[collector->ntuples + i]); - - if (tupsize > TOAST_INDEX_TARGET || tupsize >= GinMaxItemSize) - elog(ERROR, "huge tuple"); - - collector->sumsize += tupsize; + collector->sumsize += IndexTupleSize(collector->tuples[collector->ntuples + i]); } collector->ntuples += nentries; |