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/include/nodes/parsenodes.h | |
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/include/nodes/parsenodes.h')
-rw-r--r-- | src/include/nodes/parsenodes.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index c561ac62183..ce914c5cd09 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parsenodes.h,v 1.182 2002/06/20 20:29:51 momjian Exp $ + * $Id: parsenodes.h,v 1.183 2002/07/01 15:27:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -737,6 +737,12 @@ typedef struct CreateSchemaStmt List *schemaElts; /* schema components (list of parsenodes) */ } CreateSchemaStmt; +typedef enum DropBehavior +{ + DROP_RESTRICT, /* drop fails if any dependent objects */ + DROP_CASCADE /* remove dependent objects too */ +} DropBehavior; + /* ---------------------- * Alter Table * @@ -765,7 +771,7 @@ typedef struct AlterTableStmt char *name; /* column or constraint name to act on, or * new owner */ Node *def; /* definition of new column or constraint */ - int behavior; /* CASCADE or RESTRICT drop behavior */ + DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */ } AlterTableStmt; /* ---------------------- @@ -996,6 +1002,7 @@ typedef struct DropPLangStmt { NodeTag type; char *plname; /* PL name */ + DropBehavior behavior; /* RESTRICT or CASCADE behavior */ } DropPLangStmt; /* ---------------------- @@ -1107,8 +1114,8 @@ typedef struct DropStmt { NodeTag type; List *objects; /* list of sublists of names (as Values) */ - int removeType; - int behavior; /* CASCADE or RESTRICT drop behavior */ + int removeType; /* see #defines above */ + DropBehavior behavior; /* RESTRICT or CASCADE behavior */ } DropStmt; /* ---------------------- @@ -1127,7 +1134,8 @@ typedef struct DropPropertyStmt NodeTag type; RangeVar *relation; /* owning relation */ char *property; /* name of rule, trigger, etc */ - int removeType; + int removeType; /* see #defines above */ + DropBehavior behavior; /* RESTRICT or CASCADE behavior */ } DropPropertyStmt; /* ---------------------- @@ -1218,6 +1226,7 @@ typedef struct RemoveAggrStmt NodeTag type; List *aggname; /* aggregate to drop */ TypeName *aggtype; /* TypeName for input datatype, or NULL */ + DropBehavior behavior; /* RESTRICT or CASCADE behavior */ } RemoveAggrStmt; /* ---------------------- @@ -1229,6 +1238,7 @@ typedef struct RemoveFuncStmt NodeTag type; List *funcname; /* function to drop */ List *args; /* types of the arguments */ + DropBehavior behavior; /* RESTRICT or CASCADE behavior */ } RemoveFuncStmt; /* ---------------------- @@ -1240,6 +1250,7 @@ typedef struct RemoveOperStmt NodeTag type; List *opname; /* operator to drop */ List *args; /* types of the arguments */ + DropBehavior behavior; /* RESTRICT or CASCADE behavior */ } RemoveOperStmt; /* ---------------------- |