aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gin/ginfast.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-10-02 21:14:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-10-02 21:14:04 +0000
commite66d714386cd3040b328d6a894802d01dd1d395d (patch)
tree9971031124162948d5e1d622f9dff8f59d9049d1 /src/backend/access/gin/ginfast.c
parentd691cb91415542e398aa6ad015ea6a5eab53ab0d (diff)
downloadpostgresql-e66d714386cd3040b328d6a894802d01dd1d395d.tar.gz
postgresql-e66d714386cd3040b328d6a894802d01dd1d395d.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.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c
index 9d2351af529..a5d02e74a13 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.4 2009/09/15 20:31:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gin/ginfast.c,v 1.5 2009/10/02 21:14:04 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;