summaryrefslogtreecommitdiff
path: root/src/backend/rewrite
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-04-14 20:03:27 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-04-14 20:03:27 +0000
commit162bd08b3f2e6783d1d75ae79f86fc444d34a28d (patch)
tree0220cd8a906557db64763a1a57dd339de313d221 /src/backend/rewrite
parent9dc2e6deaf66f97ff9157478a517d0f48a1e5060 (diff)
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/rewrite')
-rw-r--r--src/backend/rewrite/rewriteDefine.c10
-rw-r--r--src/backend/rewrite/rewriteRemove.c9
-rw-r--r--src/backend/rewrite/rewriteSupport.c5
3 files changed, 10 insertions, 14 deletions
diff --git a/src/backend/rewrite/rewriteDefine.c b/src/backend/rewrite/rewriteDefine.c
index 8c94ab3175a..c793cabd2a9 100644
--- a/src/backend/rewrite/rewriteDefine.c
+++ b/src/backend/rewrite/rewriteDefine.c
@@ -8,14 +8,13 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.103 2005/04/14 01:38:17 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.104 2005/04/14 20:03:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/heapam.h"
-#include "catalog/catname.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
#include "catalog/pg_rewrite.h"
@@ -87,7 +86,7 @@ InsertRule(char *rulname,
/*
* Ready to store new pg_rewrite tuple
*/
- pg_rewrite_desc = heap_openr(RewriteRelationName, RowExclusiveLock);
+ pg_rewrite_desc = heap_open(RewriteRelationId, RowExclusiveLock);
/*
* Check to see if we are replacing an existing tuple
@@ -139,8 +138,7 @@ InsertRule(char *rulname,
/* If replacing, get rid of old dependencies and make new ones */
if (is_update)
- deleteDependencyRecordsFor(RelationGetRelid(pg_rewrite_desc),
- rewriteObjectId);
+ deleteDependencyRecordsFor(RewriteRelationId, rewriteObjectId);
/*
* Install dependency on rule's relation to ensure it will go away on
@@ -570,7 +568,7 @@ RenameRewriteRule(Oid owningRel, const char *oldName,
Relation pg_rewrite_desc;
HeapTuple ruletup;
- pg_rewrite_desc = heap_openr(RewriteRelationName, RowExclusiveLock);
+ pg_rewrite_desc = heap_open(RewriteRelationId, RowExclusiveLock);
ruletup = SearchSysCacheCopy(RULERELNAME,
ObjectIdGetDatum(owningRel),
diff --git a/src/backend/rewrite/rewriteRemove.c b/src/backend/rewrite/rewriteRemove.c
index 033953702a2..f06d23cc322 100644
--- a/src/backend/rewrite/rewriteRemove.c
+++ b/src/backend/rewrite/rewriteRemove.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteRemove.c,v 1.61 2004/12/31 22:00:46 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteRemove.c,v 1.62 2005/04/14 20:03:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,7 +16,6 @@
#include "access/genam.h"
#include "access/heapam.h"
-#include "catalog/catname.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
#include "catalog/pg_rewrite.h"
@@ -72,7 +71,7 @@ RemoveRewriteRule(Oid owningRel, const char *ruleName, DropBehavior behavior)
/*
* Do the deletion
*/
- object.classId = get_system_catalog_relid(RewriteRelationName);
+ object.classId = RewriteRelationId;
object.objectId = HeapTupleGetOid(tuple);
object.objectSubId = 0;
@@ -99,7 +98,7 @@ RemoveRewriteRuleById(Oid ruleOid)
/*
* Open the pg_rewrite relation.
*/
- RewriteRelation = heap_openr(RewriteRelationName, RowExclusiveLock);
+ RewriteRelation = heap_open(RewriteRelationId, RowExclusiveLock);
/*
* Find the tuple for the target rule.
@@ -109,7 +108,7 @@ RemoveRewriteRuleById(Oid ruleOid)
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(ruleOid));
- rcscan = systable_beginscan(RewriteRelation, RewriteOidIndex, true,
+ rcscan = systable_beginscan(RewriteRelation, RewriteOidIndexId, true,
SnapshotNow, 1, skey);
tuple = systable_getnext(rcscan);
diff --git a/src/backend/rewrite/rewriteSupport.c b/src/backend/rewrite/rewriteSupport.c
index 67e34916e70..8fd3bba7cde 100644
--- a/src/backend/rewrite/rewriteSupport.c
+++ b/src/backend/rewrite/rewriteSupport.c
@@ -8,14 +8,13 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteSupport.c,v 1.60 2004/12/31 22:00:46 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteSupport.c,v 1.61 2005/04/14 20:03:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/heapam.h"
-#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "rewrite/rewriteSupport.h"
#include "utils/inval.h"
@@ -60,7 +59,7 @@ SetRelationRuleStatus(Oid relationId, bool relHasRules,
* Find the tuple to update in pg_class, using syscache for the
* lookup.
*/
- relationRelation = heap_openr(RelationRelationName, RowExclusiveLock);
+ relationRelation = heap_open(RelationRelationId, RowExclusiveLock);
tuple = SearchSysCacheCopy(RELOID,
ObjectIdGetDatum(relationId),
0, 0, 0);