summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2005-03-21 01:24:04 +0000
committerTom Lane2005-03-21 01:24:04 +0000
commitee4ddac137b7c66e3bec6f74e3503236476cb16e (patch)
tree3f8d12f472288b6758fc74802230374ef0e4b764 /src/include
parentfe7015f5e821d70428995f04726215fc79294f10 (diff)
Convert index-related tuple handling routines from char 'n'/' ' to bool
convention for isnull flags. Also, remove the useless InsertIndexResult return struct from index AM aminsert calls --- there is no reason for the caller to know where in the index the tuple was inserted, and we were wasting a palloc cycle per insert to deliver this uninteresting value (plus nontrivial complexity in some AMs). I forced initdb because of the change in the signature of the aminsert routines, even though nothing really looks at those pg_proc entries...
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/genam.h6
-rw-r--r--src/include/access/hash.h4
-rw-r--r--src/include/access/heapam.h6
-rw-r--r--src/include/access/itup.h16
-rw-r--r--src/include/access/nbtree.h4
-rw-r--r--src/include/access/tuptoaster.h4
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/index.h16
-rw-r--r--src/include/catalog/pg_proc.h10
9 files changed, 29 insertions, 41 deletions
diff --git a/src/include/access/genam.h b/src/include/access/genam.h
index 573ad6d1a84..84daf30878c 100644
--- a/src/include/access/genam.h
+++ b/src/include/access/genam.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/genam.h,v 1.47 2004/12/31 22:03:21 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/access/genam.h,v 1.48 2005/03/21 01:24:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -72,8 +72,8 @@ extern Relation index_open(Oid relationId);
extern Relation index_openrv(const RangeVar *relation);
extern Relation index_openr(const char *sysRelationName);
extern void index_close(Relation relation);
-extern InsertIndexResult index_insert(Relation indexRelation,
- Datum *datums, char *nulls,
+extern bool index_insert(Relation indexRelation,
+ Datum *values, bool *isnull,
ItemPointer heap_t_ctid,
Relation heapRelation,
bool check_uniqueness);
diff --git a/src/include/access/hash.h b/src/include/access/hash.h
index 6d4668bdbe4..0b7c1a5f0f2 100644
--- a/src/include/access/hash.h
+++ b/src/include/access/hash.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/hash.h,v 1.59 2004/12/31 22:03:21 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/access/hash.h,v 1.60 2005/03/21 01:24:04 tgl Exp $
*
* NOTES
* modeled after Margo Seltzer's hash implementation for unix.
@@ -266,7 +266,7 @@ extern Datum hash_any(register const unsigned char *k, register int keylen);
/* private routines */
/* hashinsert.c */
-extern InsertIndexResult _hash_doinsert(Relation rel, HashItem hitem);
+extern void _hash_doinsert(Relation rel, HashItem hitem);
/* hashovfl.c */
extern Buffer _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf);
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h
index 6de107b76fc..5bc9eed5606 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.97 2005/03/20 23:40:29 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.98 2005/03/21 01:24:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -180,13 +180,9 @@ extern XLogRecPtr log_heap_move(Relation reln, Buffer oldbuf,
/* in common/heaptuple.c */
extern Size heap_compute_data_size(TupleDesc tupleDesc,
Datum *values, bool *isnull);
-extern Size ComputeDataSize(TupleDesc tupleDesc, Datum *values, char *nulls);
extern void heap_fill_tuple(TupleDesc tupleDesc,
Datum *values, bool *isnull,
char *data, uint16 *infomask, bits8 *bit);
-extern void DataFill(char *data, TupleDesc tupleDesc,
- Datum *values, char *nulls, uint16 *infomask,
- bits8 *bit);
extern bool heap_attisnull(HeapTuple tup, int attnum);
extern Datum nocachegetattr(HeapTuple tup, int attnum,
TupleDesc att, bool *isnull);
diff --git a/src/include/access/itup.h b/src/include/access/itup.h
index ca54dab8ef0..68b7d94cf32 100644
--- a/src/include/access/itup.h
+++ b/src/include/access/itup.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/itup.h,v 1.41 2004/12/31 22:03:21 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/access/itup.h,v 1.42 2005/03/21 01:24:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -46,14 +46,6 @@ typedef struct IndexTupleData
typedef IndexTupleData *IndexTuple;
-typedef struct InsertIndexResultData
-{
- ItemPointerData pointerData;
-} InsertIndexResultData;
-
-typedef InsertIndexResultData *InsertIndexResult;
-
-
/* ----------------
* externs
* ----------------
@@ -73,7 +65,7 @@ typedef InsertIndexResultData *InsertIndexResult;
/*
* Takes an infomask as argument (primarily because this needs to be usable
- * at index_formtuple time so enough space is allocated).
+ * at index_form_tuple time so enough space is allocated).
*
* Change me if adding an attribute to IndexTuples!!!!!!!!!!!
*/
@@ -134,8 +126,8 @@ typedef InsertIndexResultData *InsertIndexResult;
/* routines in indextuple.c */
-extern IndexTuple index_formtuple(TupleDesc tupleDescriptor,
- Datum *value, char *null);
+extern IndexTuple index_form_tuple(TupleDesc tupleDescriptor,
+ Datum *values, bool *isnull);
extern Datum nocache_index_getattr(IndexTuple tup, int attnum,
TupleDesc tupleDesc, bool *isnull);
extern IndexTuple CopyIndexTuple(IndexTuple source);
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h
index 7ed91f51ddd..8486fabcb51 100644
--- a/src/include/access/nbtree.h
+++ b/src/include/access/nbtree.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.83 2004/12/31 22:03:21 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.84 2005/03/21 01:24:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -416,7 +416,7 @@ extern Datum btvacuumcleanup(PG_FUNCTION_ARGS);
/*
* prototypes for functions in nbtinsert.c
*/
-extern InsertIndexResult _bt_doinsert(Relation rel, BTItem btitem,
+extern void _bt_doinsert(Relation rel, BTItem btitem,
bool index_is_unique, Relation heapRel);
extern Buffer _bt_getstackbuf(Relation rel, BTStack stack, int access);
extern void _bt_insert_parent(Relation rel, Buffer buf, Buffer rbuf,
diff --git a/src/include/access/tuptoaster.h b/src/include/access/tuptoaster.h
index 421b5a00ac7..1cf3b4debe6 100644
--- a/src/include/access/tuptoaster.h
+++ b/src/include/access/tuptoaster.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/access/tuptoaster.h,v 1.21 2005/01/01 05:43:09 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/access/tuptoaster.h,v 1.22 2005/03/21 01:24:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -41,7 +41,7 @@
/*
* If an index value is larger than TOAST_INDEX_TARGET, we will try to
* compress it (we can't move it out-of-line, however). Note that this
- * number is per-datum, not per-tuple, for simplicity in index_formtuple().
+ * number is per-datum, not per-tuple, for simplicity in index_form_tuple().
*/
#define TOAST_INDEX_TARGET (MaxTupleSize / 16)
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 12924b6dbed..3e72d05c99f 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.258 2005/03/16 22:59:42 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.259 2005/03/21 01:24:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200503161
+#define CATALOG_VERSION_NO 200503201
#endif
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index b7484f4450b..cd69d0f2508 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/index.h,v 1.60 2005/03/16 21:38:09 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/index.h,v 1.61 2005/03/21 01:24:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -23,11 +23,11 @@
/* Typedef for callback function for IndexBuildHeapScan */
typedef void (*IndexBuildCallback) (Relation index,
- HeapTuple htup,
- Datum *attdata,
- char *nulls,
- bool tupleIsAlive,
- void *state);
+ HeapTuple htup,
+ Datum *values,
+ bool *isnull,
+ bool tupleIsAlive,
+ void *state);
extern Oid index_create(Oid heapRelationId,
@@ -48,8 +48,8 @@ extern IndexInfo *BuildIndexInfo(Relation index);
extern void FormIndexDatum(IndexInfo *indexInfo,
TupleTableSlot *slot,
EState *estate,
- Datum *datum,
- char *nullv);
+ Datum *values,
+ bool *isnull);
extern void UpdateStats(Oid relid, double reltuples);
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index c2abf30bdec..c3edcab22b1 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.352 2005/02/28 03:45:22 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.353 2005/03/21 01:24:04 tgl Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@@ -660,7 +660,7 @@ DESCR("convert int4 to float4");
DATA(insert OID = 319 ( int4 PGNSP PGUID 12 f f t f i 1 23 "700" _null_ ftoi4 - _null_ ));
DESCR("convert float4 to int4");
-DATA(insert OID = 320 ( rtinsert PGNSP PGUID 12 f f t f v 6 2281 "2281 2281 2281 2281 2281 2281" _null_ rtinsert - _null_ ));
+DATA(insert OID = 320 ( rtinsert PGNSP PGUID 12 f f t f v 6 16 "2281 2281 2281 2281 2281 2281" _null_ rtinsert - _null_ ));
DESCR("r-tree(internal)");
DATA(insert OID = 322 ( rtgettuple PGNSP PGUID 12 f f t f v 2 16 "2281 2281" _null_ rtgettuple - _null_ ));
DESCR("r-tree(internal)");
@@ -683,7 +683,7 @@ DESCR("r-tree(internal)");
DATA(insert OID = 330 ( btgettuple PGNSP PGUID 12 f f t f v 2 16 "2281 2281" _null_ btgettuple - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 331 ( btinsert PGNSP PGUID 12 f f t f v 6 2281 "2281 2281 2281 2281 2281 2281" _null_ btinsert - _null_ ));
+DATA(insert OID = 331 ( btinsert PGNSP PGUID 12 f f t f v 6 16 "2281 2281 2281 2281 2281 2281" _null_ btinsert - _null_ ));
DESCR("btree(internal)");
DATA(insert OID = 333 ( btbeginscan PGNSP PGUID 12 f f t f v 3 2281 "2281 2281 2281" _null_ btbeginscan - _null_ ));
DESCR("btree(internal)");
@@ -798,7 +798,7 @@ DESCR("convert char(n) to name");
DATA(insert OID = 440 ( hashgettuple PGNSP PGUID 12 f f t f v 2 16 "2281 2281" _null_ hashgettuple - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 441 ( hashinsert PGNSP PGUID 12 f f t f v 6 2281 "2281 2281 2281 2281 2281 2281" _null_ hashinsert - _null_ ));
+DATA(insert OID = 441 ( hashinsert PGNSP PGUID 12 f f t f v 6 16 "2281 2281 2281 2281 2281 2281" _null_ hashinsert - _null_ ));
DESCR("hash(internal)");
DATA(insert OID = 443 ( hashbeginscan PGNSP PGUID 12 f f t f v 3 2281 "2281 2281 2281" _null_ hashbeginscan - _null_ ));
DESCR("hash(internal)");
@@ -1060,7 +1060,7 @@ DESCR("smaller of two");
DATA(insert OID = 774 ( gistgettuple PGNSP PGUID 12 f f t f v 2 16 "2281 2281" _null_ gistgettuple - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 775 ( gistinsert PGNSP PGUID 12 f f t f v 6 2281 "2281 2281 2281 2281 2281 2281" _null_ gistinsert - _null_ ));
+DATA(insert OID = 775 ( gistinsert PGNSP PGUID 12 f f t f v 6 16 "2281 2281 2281 2281 2281 2281" _null_ gistinsert - _null_ ));
DESCR("gist(internal)");
DATA(insert OID = 777 ( gistbeginscan PGNSP PGUID 12 f f t f v 3 2281 "2281 2281 2281" _null_ gistbeginscan - _null_ ));
DESCR("gist(internal)");