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/include/access/gin.h | |
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/include/access/gin.h')
-rw-r--r-- | src/include/access/gin.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/include/access/gin.h b/src/include/access/gin.h index 3f814eed73a..00dca49c01b 100644 --- a/src/include/access/gin.h +++ b/src/include/access/gin.h @@ -4,7 +4,7 @@ * * Copyright (c) 2006-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.34 2009/06/11 14:49:08 momjian Exp $ + * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.34.2.1 2009/10/02 21:14:11 tgl Exp $ *-------------------------------------------------------------------------- */ #ifndef GIN_H @@ -165,8 +165,8 @@ typedef struct #define GinGetPosting(itup) ( (ItemPointer)(( ((char*)(itup)) + SHORTALIGN(GinGetOrigSizePosting(itup)) )) ) #define GinMaxItemSize \ - ((BLCKSZ - SizeOfPageHeaderData - \ - MAXALIGN(sizeof(GinPageOpaqueData))) / 3 - sizeof(ItemIdData)) + MAXALIGN_DOWN(((BLCKSZ - SizeOfPageHeaderData - \ + MAXALIGN(sizeof(GinPageOpaqueData))) / 3 - sizeof(ItemIdData))) /* @@ -434,8 +434,9 @@ extern void ginInsertValue(GinBtree btree, GinBtreeStack *stack); extern void findParents(GinBtree btree, GinBtreeStack *stack, BlockNumber rootBlkno); /* ginentrypage.c */ -extern IndexTuple GinFormTuple(GinState *ginstate, OffsetNumber attnum, Datum key, - ItemPointerData *ipd, uint32 nipd); +extern IndexTuple GinFormTuple(Relation index, GinState *ginstate, + OffsetNumber attnum, Datum key, + ItemPointerData *ipd, uint32 nipd, bool errorTooBig); extern void GinShortenTuple(IndexTuple itup, uint32 nipd); extern void prepareEntryScan(GinBtree btree, Relation index, OffsetNumber attnum, Datum value, GinState *ginstate); |