1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-22 21:53:06 +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

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.17 2002/06/17 14:31:32 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.18 2002/07/01 15:27:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -36,7 +36,6 @@
#include "optimizer/clauses.h"
#include "optimizer/planmain.h"
#include "optimizer/prep.h"
#include "parser/parse.h"
#include "parser/parse_coerce.h"
#include "parser/parse_expr.h"
#include "parser/parse_relation.h"
@@ -280,7 +279,7 @@ DefineRelation(CreateStmt *stmt, char relkind)
* themselves will be destroyed, too.
*/
void
RemoveRelation(const RangeVar *relation)
RemoveRelation(const RangeVar *relation, DropBehavior behavior)
{
Oid relOid;
@@ -2336,7 +2335,7 @@ AlterTableAlterColumnFlags(Oid myrelid,
void
AlterTableDropColumn(Oid myrelid,
bool inh, const char *colName,
int behavior)
DropBehavior behavior)
{
elog(ERROR, "ALTER TABLE / DROP COLUMN is not implemented");
}
@@ -2669,7 +2668,7 @@ AlterTableAddConstraint(Oid myrelid,
void
AlterTableDropConstraint(Oid myrelid,
bool inh, const char *constrName,
int behavior)
DropBehavior behavior)
{
Relation rel;
int deleted;
@@ -2678,7 +2677,7 @@ AlterTableDropConstraint(Oid myrelid,
* We don't support CASCADE yet - in fact, RESTRICT doesn't work to
* the spec either!
*/
if (behavior == CASCADE)
if (behavior == DROP_CASCADE)
elog(ERROR, "ALTER TABLE / DROP CONSTRAINT does not support the CASCADE keyword");
/*