summaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorTom Lane2002-05-20 23:51:44 +0000
committerTom Lane2002-05-20 23:51:44 +0000
commit44fbe20d620d4f2e39aaa9896de4683e55b0d317 (patch)
tree5717c7d32f5f7ef72318c70c641129176820a2d0 /src/backend/utils
parentc961474c96fd1fedc25896a1de9a98caeedfbe49 (diff)
Restructure indexscan API (index_beginscan, index_getnext) per
yesterday's proposal to pghackers. Also remove unnecessary parameters to heap_beginscan, heap_rescan. I modified pg_proc.h to reflect the new numbers of parameters for the AM interface routines, but did not force an initdb because nothing actually looks at those fields.
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/not_in.c6
-rw-r--r--src/backend/utils/init/postinit.c10
-rw-r--r--src/backend/utils/misc/superuser.c6
-rw-r--r--src/backend/utils/sort/tuplesort.c6
4 files changed, 14 insertions, 14 deletions
diff --git a/src/backend/utils/adt/not_in.c b/src/backend/utils/adt/not_in.c
index 970b1fc9c29..96a6457fade 100644
--- a/src/backend/utils/adt/not_in.c
+++ b/src/backend/utils/adt/not_in.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.28 2002/03/30 01:02:41 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.29 2002/05/20 23:51:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,13 +75,13 @@ int4notin(PG_FUNCTION_ARGS)
elog(ERROR, "int4notin: unknown attribute %s for relation %s",
attribute, RelationGetRelationName(relation_to_scan));
- scan_descriptor = heap_beginscan(relation_to_scan, false, SnapshotNow,
+ scan_descriptor = heap_beginscan(relation_to_scan, SnapshotNow,
0, (ScanKey) NULL);
retval = true;
/* do a scan of the relation, and do the check */
- while (HeapTupleIsValid(current_tuple = heap_getnext(scan_descriptor, 0)))
+ while ((current_tuple = heap_getnext(scan_descriptor, ForwardScanDirection)) != NULL)
{
value = heap_getattr(current_tuple,
(AttrNumber) attrid,
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 817c87c80a0..5c0fd2d3ea7 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.105 2002/05/17 01:19:18 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.106 2002/05/20 23:51:43 tgl Exp $
*
*
*-------------------------------------------------------------------------
@@ -95,9 +95,9 @@ ReverifyMyDatabase(const char *name)
ScanKeyEntryInitialize(&key, 0, Anum_pg_database_datname,
F_NAMEEQ, NameGetDatum(name));
- pgdbscan = heap_beginscan(pgdbrel, 0, SnapshotNow, 1, &key);
+ pgdbscan = heap_beginscan(pgdbrel, SnapshotNow, 1, &key);
- tup = heap_getnext(pgdbscan, 0);
+ tup = heap_getnext(pgdbscan, ForwardScanDirection);
if (!HeapTupleIsValid(tup) ||
tup->t_data->t_oid != MyDatabaseId)
{
@@ -456,8 +456,8 @@ ThereIsAtLeastOneUser(void)
pg_shadow_rel = heap_openr(ShadowRelationName, AccessExclusiveLock);
pg_shadow_dsc = RelationGetDescr(pg_shadow_rel);
- scan = heap_beginscan(pg_shadow_rel, false, SnapshotNow, 0, 0);
- result = HeapTupleIsValid(heap_getnext(scan, 0));
+ scan = heap_beginscan(pg_shadow_rel, SnapshotNow, 0, NULL);
+ result = (heap_getnext(scan, ForwardScanDirection) != NULL);
heap_endscan(scan);
heap_close(pg_shadow_rel, AccessExclusiveLock);
diff --git a/src/backend/utils/misc/superuser.c b/src/backend/utils/misc/superuser.c
index 4a3f3de1c54..5848b444199 100644
--- a/src/backend/utils/misc/superuser.c
+++ b/src/backend/utils/misc/superuser.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.21 2002/04/11 05:32:03 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.22 2002/05/20 23:51:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -80,8 +80,8 @@ is_dbadmin(Oid dbid)
ScanKeyEntryInitialize(&entry[0], 0x0,
ObjectIdAttributeNumber, F_OIDEQ,
ObjectIdGetDatum(dbid));
- scan = heap_beginscan(pg_database, 0, SnapshotNow, 1, entry);
- dbtuple = heap_getnext(scan, 0);
+ scan = heap_beginscan(pg_database, SnapshotNow, 1, entry);
+ dbtuple = heap_getnext(scan, ForwardScanDirection);
if (!HeapTupleIsValid(dbtuple))
elog(ERROR, "database %u does not exist", dbid);
dba = ((Form_pg_database) GETSTRUCT(dbtuple))->datdba;
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index ad169856a17..b4b86b95b87 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -78,7 +78,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.22 2002/01/06 00:37:44 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.23 2002/05/20 23:51:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2076,9 +2076,9 @@ SelectSortFunction(Oid sortOperator,
ObjectIdGetDatum(sortOperator));
relation = heap_openr(AccessMethodOperatorRelationName, AccessShareLock);
- scan = heap_beginscan(relation, false, SnapshotNow, 1, skey);
+ scan = heap_beginscan(relation, SnapshotNow, 1, skey);
- while (HeapTupleIsValid(tuple = heap_getnext(scan, 0)))
+ while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
Form_pg_amop aform = (Form_pg_amop) GETSTRUCT(tuple);