diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/commands/defrem.h | 11 | ||||
-rw-r--r-- | src/include/commands/tablecmds.h | 10 | ||||
-rw-r--r-- | src/include/commands/view.h | 4 | ||||
-rw-r--r-- | src/include/nodes/parsenodes.h | 21 |
4 files changed, 29 insertions, 17 deletions
diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index 653e22686f5..551deae0956 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.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: defrem.h,v 1.39 2002/06/20 20:29:49 momjian Exp $ + * $Id: defrem.h,v 1.40 2002/07/01 15:27:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -29,7 +29,7 @@ extern void DefineIndex(RangeVar *heapRelation, bool primary, Expr *predicate, List *rangetable); -extern void RemoveIndex(RangeVar *relation); +extern void RemoveIndex(RangeVar *relation, DropBehavior behavior); extern void ReindexIndex(RangeVar *indexRelation, bool force); extern void ReindexTable(RangeVar *relation, bool force); extern void ReindexDatabase(const char *databaseName, bool force, bool all); @@ -42,16 +42,15 @@ extern void CreateFunction(CreateFunctionStmt *stmt); extern void RemoveFunction(List *functionName, List *argTypes); extern void DefineOperator(List *names, List *parameters); -extern void RemoveOperator(List *operatorName, - TypeName *typeName1, TypeName *typeName2); +extern void RemoveOperator(RemoveOperStmt *stmt); extern void DefineAggregate(List *names, List *parameters); extern void RemoveAggregate(List *aggName, TypeName *aggType); extern void DefineType(List *names, List *parameters); -extern void RemoveType(List *names); +extern void RemoveType(List *names, DropBehavior behavior); extern void DefineDomain(CreateDomainStmt *stmt); -extern void RemoveDomain(List *names, int behavior); +extern void RemoveDomain(List *names, DropBehavior behavior); /* support routines in commands/define.c */ diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h index 646ae45d240..d38ea537c6d 100644 --- a/src/include/commands/tablecmds.h +++ b/src/include/commands/tablecmds.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: tablecmds.h,v 1.4 2002/04/30 01:24:52 tgl Exp $ + * $Id: tablecmds.h,v 1.5 2002/07/01 15:27:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -34,13 +34,15 @@ extern void AlterTableAlterColumnFlags(Oid myrelid, bool inh, Node *flagValue, const char *flagType); extern void AlterTableDropColumn(Oid myrelid, bool inh, - const char *colName, int behavior); + const char *colName, + DropBehavior behavior); extern void AlterTableAddConstraint(Oid myrelid, bool inh, List *newConstraints); extern void AlterTableDropConstraint(Oid myrelid, bool inh, - const char *constrName, int behavior); + const char *constrName, + DropBehavior behavior); extern void AlterTableCreateToastTable(Oid relOid, bool silent); @@ -48,7 +50,7 @@ extern void AlterTableOwner(Oid relationOid, int32 newOwnerSysId); extern Oid DefineRelation(CreateStmt *stmt, char relkind); -extern void RemoveRelation(const RangeVar *relation); +extern void RemoveRelation(const RangeVar *relation, DropBehavior behavior); extern void TruncateRelation(const RangeVar *relation); diff --git a/src/include/commands/view.h b/src/include/commands/view.h index 4fd6bd9a1a5..3603f2a4fab 100644 --- a/src/include/commands/view.h +++ b/src/include/commands/view.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: view.h,v 1.15 2002/06/20 20:29:49 momjian Exp $ + * $Id: view.h,v 1.16 2002/07/01 15:27:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,6 +17,6 @@ #include "nodes/parsenodes.h" extern void DefineView(const RangeVar *view, Query *view_parse); -extern void RemoveView(const RangeVar *view); +extern void RemoveView(const RangeVar *view, DropBehavior behavior); #endif /* VIEW_H */ 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; /* ---------------------- |