1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

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.
This commit is contained in:
Tom Lane
2002-07-01 15:27:56 +00:00
parent a3ec44a5d3
commit 131f801d37
13 changed files with 111 additions and 101 deletions

View File

@@ -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: