diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-07-01 15:27:56 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-07-01 15:27:56 +0000 |
commit | 131f801d37b77d3633c07142010d1968c09e3fd8 (patch) | |
tree | 236b50e70f0ceb7bbc203c6c95c8b825069cb56d /src/backend/tcop/utility.c | |
parent | a3ec44a5d3206a50782ac0b4c7990cf1cdaf0092 (diff) | |
download | postgresql-131f801d37b77d3633c07142010d1968c09e3fd8.tar.gz postgresql-131f801d37b77d3633c07142010d1968c09e3fd8.zip |
First phase of applying Rod Taylor's pg_depend patch. This just adds
RESTRICT/CASCADE syntax to the DROP commands that need it, and propagates
the behavioral option through the parser to the routines that execute
drops. Doesn't do anything useful yet, but I figured I'd commit these
changes so I could get out of the parser area while working on the rest.
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r-- | src/backend/tcop/utility.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 8277a165791..f5c38d071ed 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.159 2002/06/20 20:29:36 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.160 2002/07/01 15:27:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -289,30 +289,30 @@ ProcessUtility(Node *parsetree, case DROP_TABLE: rel = makeRangeVarFromNameList(names); CheckDropPermissions(rel, RELKIND_RELATION); - RemoveRelation(rel); + RemoveRelation(rel, stmt->behavior); break; case DROP_SEQUENCE: rel = makeRangeVarFromNameList(names); CheckDropPermissions(rel, RELKIND_SEQUENCE); - RemoveRelation(rel); + RemoveRelation(rel, stmt->behavior); break; case DROP_VIEW: rel = makeRangeVarFromNameList(names); CheckDropPermissions(rel, RELKIND_VIEW); - RemoveView(rel); + RemoveView(rel, stmt->behavior); break; case DROP_INDEX: rel = makeRangeVarFromNameList(names); CheckDropPermissions(rel, RELKIND_INDEX); - RemoveIndex(rel); + RemoveIndex(rel, stmt->behavior); break; case DROP_TYPE: /* RemoveType does its own permissions checks */ - RemoveType(names); + RemoveType(names, stmt->behavior); break; case DROP_DOMAIN: @@ -606,24 +606,15 @@ ProcessUtility(Node *parsetree, break; case T_RemoveOperStmt: - { - RemoveOperStmt *stmt = (RemoveOperStmt *) parsetree; - TypeName *typenode1 = (TypeName *) lfirst(stmt->args); - TypeName *typenode2 = (TypeName *) lsecond(stmt->args); - - RemoveOperator(stmt->opname, typenode1, typenode2); - } + RemoveOperator((RemoveOperStmt *) parsetree); break; case T_CreatedbStmt: - { - CreatedbStmt *stmt = (CreatedbStmt *) parsetree; - createdb(stmt); - } + createdb((CreatedbStmt *) parsetree); break; case T_AlterDatabaseSetStmt: - AlterDatabaseSet((AlterDatabaseSetStmt *)parsetree); + AlterDatabaseSet((AlterDatabaseSetStmt *) parsetree); break; case T_DropdbStmt: |