diff options
| author | Tom Lane | 2002-04-18 20:01:11 +0000 |
|---|---|---|
| committer | Tom Lane | 2002-04-18 20:01:11 +0000 |
| commit | b3120804ad1692322a6d905b352df7fa0d7cdd80 (patch) | |
| tree | 93aaf632df82db20e63c952be8a6fd1e4ec15629 /src/backend/tcop | |
| parent | 4e08a625b006ba3992be881b516773adba5863e4 (diff) | |
Rule names are now unique per-relation, rather than unique globally.
DROP RULE and COMMENT ON RULE syntax adds an 'ON tablename' clause,
similar to TRIGGER syntaxes. To allow loading of existing pg_dump
files containing COMMENT ON RULE, the COMMENT code will still accept
the old syntax --- but only if the target rulename is unique across
the whole database.
Diffstat (limited to 'src/backend/tcop')
| -rw-r--r-- | src/backend/tcop/postgres.c | 6 | ||||
| -rw-r--r-- | src/backend/tcop/utility.c | 27 |
2 files changed, 20 insertions, 13 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index bef1b8064c7..d8c2065258b 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.260 2002/03/24 04:31:07 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.261 2002/04/18 20:01:09 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1688,7 +1688,7 @@ PostgresMain(int argc, char *argv[], const char *username) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.260 $ $Date: 2002/03/24 04:31:07 $\n"); + puts("$Revision: 1.261 $ $Date: 2002/04/18 20:01:09 $\n"); } /* @@ -2322,7 +2322,7 @@ CreateCommandTag(Node *parsetree) tag = "CREATE"; break; - case T_DropTrigStmt: + case T_DropPropertyStmt: tag = "DROP"; break; diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 63e6b5dd9b2..24a1e3d2964 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.149 2002/04/15 05:22:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.150 2002/04/18 20:01:09 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -312,11 +312,6 @@ ProcessUtility(Node *parsetree, RemoveIndex(rel); break; - case DROP_RULE: - /* RemoveRewriteRule checks permissions */ - RemoveRewriteRule(names); - break; - case DROP_TYPE: /* RemoveType does its own permissions checks */ RemoveType(names); @@ -714,12 +709,24 @@ ProcessUtility(Node *parsetree, CreateTrigger((CreateTrigStmt *) parsetree); break; - case T_DropTrigStmt: + case T_DropPropertyStmt: { - DropTrigStmt *stmt = (DropTrigStmt *) parsetree; + DropPropertyStmt *stmt = (DropPropertyStmt *) parsetree; + Oid relId; - DropTrigger(RangeVarGetRelid(stmt->relation, false), - stmt->trigname); + relId = RangeVarGetRelid(stmt->relation, false); + + switch (stmt->removeType) + { + case DROP_RULE: + /* RemoveRewriteRule checks permissions */ + RemoveRewriteRule(relId, stmt->property); + break; + case DROP_TRIGGER: + /* DropTrigger checks permissions */ + DropTrigger(relId, stmt->property); + break; + } } break; |
