diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-02 21:14:04 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-02 21:14:04 +0000 |
commit | e66d714386cd3040b328d6a894802d01dd1d395d (patch) | |
tree | 9971031124162948d5e1d622f9dff8f59d9049d1 /src/include/access/gin.h | |
parent | d691cb91415542e398aa6ad015ea6a5eab53ab0d (diff) | |
download | postgresql-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/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..a0d6a0d8f27 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.35 2009/10/02 21:14:04 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); |