aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistutil.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2008-06-12 09:12:31 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2008-06-12 09:12:31 +0000
commita213f1ee6c5a1bbe1f074ca201975e76ad2ed50c (patch)
treec5ac3531c006389123da3ba506e5b25eb09ecd02 /src/backend/access/gist/gistutil.c
parentc4f2a0458dc029d1214f013f1434f70f5194e56d (diff)
downloadpostgresql-a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c.tar.gz
postgresql-a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c.zip
Refactor XLogOpenRelation() and XLogReadBuffer() in preparation for relation
forks. XLogOpenRelation() and the associated light-weight relation cache in xlogutils.c is gone, and XLogReadBuffer() now takes a RelFileNode as argument, instead of Relation. For functions that still need a Relation struct during WAL replay, there's a new function called CreateFakeRelcacheEntry() that returns a fake entry like XLogOpenRelation() used to.
Diffstat (limited to 'src/backend/access/gist/gistutil.c')
-rw-r--r--src/backend/access/gist/gistutil.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c
index 9847e412e2f..ef60b6b96d1 100644
--- a/src/backend/access/gist/gistutil.c
+++ b/src/backend/access/gist/gistutil.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gistutil.c,v 1.26 2008/05/12 00:00:44 alvherre Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gistutil.c,v 1.27 2008/06/12 09:12:29 heikki Exp $
*-------------------------------------------------------------------------
*/
#include "postgres.h"
@@ -27,11 +27,10 @@ static Datum attrS[INDEX_MAX_KEYS];
static bool isnullS[INDEX_MAX_KEYS];
/*
- * Write itup vector to page, has no control of free space
+ * Write itup vector to page, has no control of free space.
*/
-OffsetNumber
-gistfillbuffer(Relation r, Page page, IndexTuple *itup,
- int len, OffsetNumber off)
+void
+gistfillbuffer(Page page, IndexTuple *itup, int len, OffsetNumber off)
{
OffsetNumber l = InvalidOffsetNumber;
int i;
@@ -42,14 +41,13 @@ gistfillbuffer(Relation r, Page page, IndexTuple *itup,
for (i = 0; i < len; i++)
{
- l = PageAddItem(page, (Item) itup[i], IndexTupleSize(itup[i]),
- off, false, false);
+ Size sz = IndexTupleSize(itup[i]);
+ l = PageAddItem(page, (Item) itup[i], sz, off, false, false);
if (l == InvalidOffsetNumber)
- elog(ERROR, "failed to add item to index page in \"%s\"",
- RelationGetRelationName(r));
+ elog(ERROR, "failed to add item to GiST index page, item %d out of %d, size %d bytes",
+ i, len, sz);
off++;
}
- return l;
}
/*