summaryrefslogtreecommitdiff
path: root/src/backend/rewrite
diff options
context:
space:
mode:
authorPeter Eisentraut2017-02-22 13:45:14 +0000
committerPeter Eisentraut2017-02-23 13:19:52 +0000
commite8d016d81940e75c126aa52971b7903b7301002e (patch)
tree549e818e8125c1a75ed616bd8d7363aaa3c1e408 /src/backend/rewrite
parent9e43e8714c9e976e41b7429fa7c426c9a6e5e8e6 (diff)
Remove deprecated COMMENT ON RULE syntax
This was only used for allowing upgrades from pre-7.3 instances, which was a long time ago.
Diffstat (limited to 'src/backend/rewrite')
-rw-r--r--src/backend/rewrite/rewriteSupport.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/backend/rewrite/rewriteSupport.c b/src/backend/rewrite/rewriteSupport.c
index c4d05d26d46..ce9c8e37938 100644
--- a/src/backend/rewrite/rewriteSupport.c
+++ b/src/backend/rewrite/rewriteSupport.c
@@ -114,58 +114,3 @@ get_rewrite_oid(Oid relid, const char *rulename, bool missing_ok)
ReleaseSysCache(tuple);
return ruleoid;
}
-
-/*
- * Find rule oid, given only a rule name but no rel OID.
- *
- * If there's more than one, it's an error. If there aren't any, that's an
- * error, too. In general, this should be avoided - it is provided to support
- * syntax that is compatible with pre-7.3 versions of PG, where rule names
- * were unique across the entire database.
- */
-Oid
-get_rewrite_oid_without_relid(const char *rulename,
- Oid *reloid, bool missing_ok)
-{
- Relation RewriteRelation;
- HeapScanDesc scanDesc;
- ScanKeyData scanKeyData;
- HeapTuple htup;
- Oid ruleoid;
-
- /* Search pg_rewrite for such a rule */
- ScanKeyInit(&scanKeyData,
- Anum_pg_rewrite_rulename,
- BTEqualStrategyNumber, F_NAMEEQ,
- CStringGetDatum(rulename));
-
- RewriteRelation = heap_open(RewriteRelationId, AccessShareLock);
- scanDesc = heap_beginscan_catalog(RewriteRelation, 1, &scanKeyData);
-
- htup = heap_getnext(scanDesc, ForwardScanDirection);
- if (!HeapTupleIsValid(htup))
- {
- if (!missing_ok)
- ereport(ERROR,
- (errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("rule \"%s\" does not exist", rulename)));
- ruleoid = InvalidOid;
- }
- else
- {
- ruleoid = HeapTupleGetOid(htup);
- if (reloid != NULL)
- *reloid = ((Form_pg_rewrite) GETSTRUCT(htup))->ev_class;
-
- htup = heap_getnext(scanDesc, ForwardScanDirection);
- if (HeapTupleIsValid(htup))
- ereport(ERROR,
- (errcode(ERRCODE_DUPLICATE_OBJECT),
- errmsg("there are multiple rules named \"%s\"", rulename),
- errhint("Specify a relation name as well as a rule name.")));
- }
- heap_endscan(scanDesc);
- heap_close(RewriteRelation, AccessShareLock);
-
- return ruleoid;
-}