diff options
| author | Tom Lane | 2005-03-21 01:24:04 +0000 |
|---|---|---|
| committer | Tom Lane | 2005-03-21 01:24:04 +0000 |
| commit | ee4ddac137b7c66e3bec6f74e3503236476cb16e (patch) | |
| tree | 3f8d12f472288b6758fc74802230374ef0e4b764 /src/include/access | |
| parent | fe7015f5e821d70428995f04726215fc79294f10 (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/access')
| -rw-r--r-- | src/include/access/genam.h | 6 | ||||
| -rw-r--r-- | src/include/access/hash.h | 4 | ||||
| -rw-r--r-- | src/include/access/heapam.h | 6 | ||||
| -rw-r--r-- | src/include/access/itup.h | 16 | ||||
| -rw-r--r-- | src/include/access/nbtree.h | 4 | ||||
| -rw-r--r-- | src/include/access/tuptoaster.h | 4 |
6 files changed, 14 insertions, 26 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) |
