diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-14 20:03:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-14 20:03:27 +0000 |
commit | 162bd08b3f2e6783d1d75ae79f86fc444d34a28d (patch) | |
tree | 0220cd8a906557db64763a1a57dd339de313d221 /src/backend/access/index/genam.c | |
parent | 9dc2e6deaf66f97ff9157478a517d0f48a1e5060 (diff) | |
download | postgresql-162bd08b3f2e6783d1d75ae79f86fc444d34a28d.tar.gz postgresql-162bd08b3f2e6783d1d75ae79f86fc444d34a28d.zip |
Completion of project to use fixed OIDs for all system catalogs and
indexes. Replace all heap_openr and index_openr calls by heap_open
and index_open. Remove runtime lookups of catalog OID numbers in
various places. Remove relcache's support for looking up system
catalogs by name. Bulky but mostly very boring patch ...
Diffstat (limited to 'src/backend/access/index/genam.c')
-rw-r--r-- | src/backend/access/index/genam.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c index 74f5bb7dd6f..d2504de2190 100644 --- a/src/backend/access/index/genam.c +++ b/src/backend/access/index/genam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.46 2005/03/29 00:16:51 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.47 2005/04/14 20:03:23 tgl Exp $ * * NOTES * many of the old access method routines have been turned into @@ -162,7 +162,7 @@ IndexScanEnd(IndexScanDesc scan) * systable_beginscan --- set up for heap-or-index scan * * rel: catalog to scan, already opened and suitably locked - * indexRelname: name of index to conditionally use + * indexId: OID of index to conditionally use * indexOK: if false, forces a heap scan (see notes below) * snapshot: time qual to use (usually should be SnapshotNow) * nkeys, key: scan keys @@ -179,7 +179,7 @@ IndexScanEnd(IndexScanDesc scan) */ SysScanDesc systable_beginscan(Relation heapRelation, - const char *indexRelname, + Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key) @@ -187,18 +187,10 @@ systable_beginscan(Relation heapRelation, SysScanDesc sysscan; Relation irel; - if (indexOK && !IsIgnoringSystemIndexes()) - { - /* We assume it's a system index, so index_openr is OK */ - irel = index_openr(indexRelname); - - if (ReindexIsProcessingIndex(RelationGetRelid(irel))) - { - /* oops, can't use index that's being rebuilt */ - index_close(irel); - irel = NULL; - } - } + if (indexOK && + !IsIgnoringSystemIndexes() && + !ReindexIsProcessingIndex(indexId)) + irel = index_open(indexId); else irel = NULL; |