aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-08-26 06:32:06 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-08-26 06:32:06 +0000
commita2740a455f558a1b8b9cd1962f92980efa4a984a (patch)
tree6f52d29248743f100fa40c32cef2cd48043c43f5 /src/backend/access
parentfe87dbb1403c557bee85115ebe12b69f9ee92ed3 (diff)
downloadpostgresql-a2740a455f558a1b8b9cd1962f92980efa4a984a.tar.gz
postgresql-a2740a455f558a1b8b9cd1962f92980efa4a984a.zip
There, now we support GiST...now what? :)
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/Makefile.inc9
-rw-r--r--src/backend/access/genam.h5
-rw-r--r--src/backend/access/hash.h5
-rw-r--r--src/backend/access/hash/hash.c11
-rw-r--r--src/backend/access/index/indexam.c8
-rw-r--r--src/backend/access/nbtree.h5
-rw-r--r--src/backend/access/nbtree/nbtree.c10
-rw-r--r--src/backend/access/rtree/rtree.c8
8 files changed, 42 insertions, 19 deletions
diff --git a/src/backend/access/Makefile.inc b/src/backend/access/Makefile.inc
index 6adc2c692b5..eeff8b43be5 100644
--- a/src/backend/access/Makefile.inc
+++ b/src/backend/access/Makefile.inc
@@ -7,18 +7,19 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/access/Attic/Makefile.inc,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/backend/access/Attic/Makefile.inc,v 1.2 1996/08/26 06:26:37 scrappy Exp $
#
#-------------------------------------------------------------------------
accdir=$(CURDIR)/access
VPATH:=$(VPATH):$(accdir):\
- $(accdir)/common:$(accdir)/hash:$(accdir)/heap:$(accdir)/index:\
- $(accdir)/rtree:$(accdir)/nbtree:$(accdir)/transam
+ $(accdir)/common:$(accdir)/gist:$(accdir)/hash:$(accdir)/heap:\
+ $(accdir)/index:$(accdir)/rtree:$(accdir)/nbtree:$(accdir)/transam
SUBSRCS=
include $(accdir)/common/Makefile.inc
+include $(accdir)/gist/Makefile.inc
include $(accdir)/hash/Makefile.inc
include $(accdir)/heap/Makefile.inc
include $(accdir)/index/Makefile.inc
@@ -27,7 +28,7 @@ include $(accdir)/nbtree/Makefile.inc
include $(accdir)/transam/Makefile.inc
SRCS_ACCESS:= $(SUBSRCS)
-HEADERS+= attnum.h funcindex.h genam.h hash.h \
+HEADERS+= attnum.h funcindex.h genam.h gist.h hash.h \
heapam.h hio.h htup.h ibit.h iqual.h istrat.h \
itup.h nbtree.h printtup.h relscan.h rtree.h \
sdir.h skey.h strat.h transam.h tupdesc.h tupmacs.h \
diff --git a/src/backend/access/genam.h b/src/backend/access/genam.h
index b2544650de8..8b2ac52e738 100644
--- a/src/backend/access/genam.h
+++ b/src/backend/access/genam.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: genam.h,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
+ * $Id: genam.h,v 1.2 1996/08/26 06:26:40 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -32,7 +32,8 @@ extern Relation index_open(Oid relationId);
extern Relation index_openr(char *relationName);
extern void index_close(Relation relation);
extern InsertIndexResult index_insert(Relation relation,
- IndexTuple indexTuple);
+ Datum *datum, char *nulls,
+ ItemPointer heap_t_ctid);
extern void index_delete(Relation relation, ItemPointer indexItem);
extern IndexScanDesc index_beginscan(Relation relation, bool scanFromEnd,
uint16 numberOfKeys, ScanKey key);
diff --git a/src/backend/access/hash.h b/src/backend/access/hash.h
index 21407696b44..461e7232e69 100644
--- a/src/backend/access/hash.h
+++ b/src/backend/access/hash.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: hash.h,v 1.1.1.1 1996/07/09 06:21:08 scrappy Exp $
+ * $Id: hash.h,v 1.2 1996/08/26 06:26:42 scrappy Exp $
*
* NOTES
* modeled after Margo Seltzer's hash implementation for unix.
@@ -250,7 +250,8 @@ typedef HashItemData *HashItem;
extern void hashbuild(Relation heap, Relation index, int natts,
AttrNumber *attnum, IndexStrategy istrat, uint16 pcount,
Datum *params, FuncIndexInfo *finfo, PredInfo *predInfo);
-extern InsertIndexResult hashinsert(Relation rel, IndexTuple itup);
+extern InsertIndexResult hashinsert(Relation rel, Datum *datum, char *nulls,
+ ItemPointer ht_ctid);
extern char *hashgettuple(IndexScanDesc scan, ScanDirection dir);
extern char *hashbeginscan(Relation rel, bool fromEnd, uint16 keysz,
ScanKey scankey);
diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c
index a4a4e16e599..bd3b8cd73ce 100644
--- a/src/backend/access/hash/hash.c
+++ b/src/backend/access/hash/hash.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.1.1.1 1996/07/09 06:21:10 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.2 1996/08/26 06:27:28 scrappy Exp $
*
* NOTES
* This file contains only the public interface routines.
@@ -252,11 +252,17 @@ hashbuild(Relation heap,
* to the caller.
*/
InsertIndexResult
-hashinsert(Relation rel, IndexTuple itup)
+hashinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid)
{
HashItem hitem;
+ IndexTuple itup;
InsertIndexResult res;
+
+ /* generate an index tuple */
+ itup = index_formtuple(RelationGetTupleDescriptor(rel), datum, nulls);
+ itup->t_tid = *ht_ctid;
+
if (itup->t_info & INDEX_NULL_MASK)
return ((InsertIndexResult) NULL);
@@ -265,6 +271,7 @@ hashinsert(Relation rel, IndexTuple itup)
res = _hash_doinsert(rel, hitem);
pfree(hitem);
+ pfree(itup);
return (res);
}
diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c
index bffe3a41f3a..32e42011199 100644
--- a/src/backend/access/index/indexam.c
+++ b/src/backend/access/index/indexam.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.1.1.1 1996/07/09 06:21:11 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.2 1996/08/26 06:27:48 scrappy Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relationId
@@ -179,7 +179,9 @@ index_close(Relation relation)
*/
InsertIndexResult
index_insert(Relation relation,
- IndexTuple indexTuple)
+ Datum *datum,
+ char *nulls,
+ ItemPointer heap_t_ctid)
{
RegProcedure procedure;
InsertIndexResult specificResult;
@@ -192,7 +194,7 @@ index_insert(Relation relation,
* ----------------
*/
specificResult = (InsertIndexResult)
- fmgr(procedure, relation, indexTuple, NULL);
+ fmgr(procedure, relation, datum, nulls, heap_t_ctid, NULL);
/* ----------------
* the insert proc is supposed to return a "specific result" and
diff --git a/src/backend/access/nbtree.h b/src/backend/access/nbtree.h
index 051fb8f6eb0..4dfcf3dbaef 100644
--- a/src/backend/access/nbtree.h
+++ b/src/backend/access/nbtree.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nbtree.h,v 1.2 1996/07/30 07:55:10 scrappy Exp $
+ * $Id: nbtree.h,v 1.3 1996/08/26 06:26:44 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -201,7 +201,8 @@ extern bool BuildingBtree; /* in nbtree.c */
extern void btbuild(Relation heap, Relation index, int natts,
AttrNumber *attnum, IndexStrategy istrat, uint16 pcount,
Datum *params, FuncIndexInfo *finfo, PredInfo *predInfo);
-extern InsertIndexResult btinsert(Relation rel, IndexTuple itup);
+extern InsertIndexResult btinsert(Relation rel, Datum *datum, char *nulls,
+ ItemPointer ht_ctid);
extern char *btgettuple(IndexScanDesc scan, ScanDirection dir);
extern char *btbeginscan(Relation rel, bool fromEnd, uint16 keysz,
ScanKey scankey);
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index 5829e8afe07..90afe6b3637 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.2 1996/07/30 07:56:00 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.3 1996/08/26 06:28:21 scrappy Exp $
*
* NOTES
* This file contains only the public interface routines.
@@ -285,11 +285,16 @@ btbuild(Relation heap,
* return an InsertIndexResult to the caller.
*/
InsertIndexResult
-btinsert(Relation rel, IndexTuple itup)
+btinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid)
{
BTItem btitem;
+ IndexTuple itup;
InsertIndexResult res;
+ /* generate an index tuple */
+ itup = index_formtuple(RelationGetTupleDescriptor(rel), datum, nulls);
+ itup->t_tid = *ht_ctid;
+
if (itup->t_info & INDEX_NULL_MASK)
return ((InsertIndexResult) NULL);
@@ -297,6 +302,7 @@ btinsert(Relation rel, IndexTuple itup)
res = _bt_doinsert(rel, btitem);
pfree(btitem);
+ pfree(itup);
return (res);
}
diff --git a/src/backend/access/rtree/rtree.c b/src/backend/access/rtree/rtree.c
index 96efc3bc90b..1edec246bc9 100644
--- a/src/backend/access/rtree/rtree.c
+++ b/src/backend/access/rtree/rtree.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.1.1.1 1996/07/09 06:21:13 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.2 1996/08/26 06:29:10 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -273,11 +273,15 @@ rtbuild(Relation heap,
* It doesn't do any work; just locks the relation and passes the buck.
*/
InsertIndexResult
-rtinsert(Relation r, IndexTuple itup)
+rtinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid)
{
InsertIndexResult res;
+ IndexTuple itup;
RTSTATE rtState;
+ /* generate an index tuple */
+ itup = index_formtuple(RelationGetTupleDescriptor(r), datum, nulls);
+ itup->t_tid = *ht_ctid;
initRtstate(&rtState, r);
RelationSetLockForWrite(r);