aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/async.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-05-20 23:51:44 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-05-20 23:51:44 +0000
commit44fbe20d620d4f2e39aaa9896de4683e55b0d317 (patch)
tree5717c7d32f5f7ef72318c70c641129176820a2d0 /src/backend/commands/async.c
parentc961474c96fd1fedc25896a1de9a98caeedfbe49 (diff)
downloadpostgresql-44fbe20d620d4f2e39aaa9896de4683e55b0d317.tar.gz
postgresql-44fbe20d620d4f2e39aaa9896de4683e55b0d317.zip
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/commands/async.c')
-rw-r--r--src/backend/commands/async.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index 8193174aec9..271be151195 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.84 2002/05/05 00:03:28 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.85 2002/05/20 23:51:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -204,8 +204,8 @@ Async_Listen(char *relname, int pid)
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
/* Detect whether we are already listening on this relname */
- scan = heap_beginscan(lRel, 0, SnapshotNow, 0, (ScanKey) NULL);
- while (HeapTupleIsValid(tuple = heap_getnext(scan, 0)))
+ scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL);
+ while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(tuple);
@@ -305,8 +305,8 @@ Async_Unlisten(char *relname, int pid)
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
- scan = heap_beginscan(lRel, 0, SnapshotNow, 0, (ScanKey) NULL);
- while (HeapTupleIsValid(tuple = heap_getnext(scan, 0)))
+ scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL);
+ while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(tuple);
@@ -369,9 +369,9 @@ Async_UnlistenAll(void)
Anum_pg_listener_pid,
F_INT4EQ,
Int32GetDatum(MyProcPid));
- scan = heap_beginscan(lRel, 0, SnapshotNow, 1, key);
+ scan = heap_beginscan(lRel, SnapshotNow, 1, key);
- while (HeapTupleIsValid(lTuple = heap_getnext(scan, 0)))
+ while ((lTuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
simple_heap_delete(lRel, &lTuple->t_self);
heap_endscan(scan);
@@ -472,9 +472,9 @@ AtCommit_Notify(void)
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
tdesc = RelationGetDescr(lRel);
- scan = heap_beginscan(lRel, 0, SnapshotNow, 0, (ScanKey) NULL);
+ scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL);
- while (HeapTupleIsValid(lTuple = heap_getnext(scan, 0)))
+ while ((lTuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(lTuple);
char *relname = NameStr(listener->relname);
@@ -773,7 +773,7 @@ ProcessIncomingNotify(void)
Anum_pg_listener_pid,
F_INT4EQ,
Int32GetDatum(MyProcPid));
- scan = heap_beginscan(lRel, 0, SnapshotNow, 1, key);
+ scan = heap_beginscan(lRel, SnapshotNow, 1, key);
/* Prepare data for rewriting 0 into notification field */
nulls[0] = nulls[1] = nulls[2] = ' ';
@@ -782,7 +782,7 @@ ProcessIncomingNotify(void)
value[0] = value[1] = value[2] = (Datum) 0;
value[Anum_pg_listener_notify - 1] = Int32GetDatum(0);
- while (HeapTupleIsValid(lTuple = heap_getnext(scan, 0)))
+ while ((lTuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(lTuple);
char *relname = NameStr(listener->relname);