diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-07-12 18:43:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-07-12 18:43:19 +0000 |
commit | 7c6df91dda27accab3097390ef0d21d93028c7a1 (patch) | |
tree | 5705b975e8de4edf82252e6df28e0bd57c83cb95 /src/backend/commands/indexcmds.c | |
parent | 791a40f943e2a9353c5823fb4f2bd446ec623d38 (diff) | |
download | postgresql-7c6df91dda27accab3097390ef0d21d93028c7a1.tar.gz postgresql-7c6df91dda27accab3097390ef0d21d93028c7a1.zip |
Second phase of committing Rod Taylor's pg_depend/pg_constraint patch.
pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY
constraints all have real live entries in pg_constraint. pg_depend
exists, and RESTRICT/CASCADE options work on most kinds of DROP;
however, pg_depend is not yet very well populated with dependencies.
(Most of the ones that are present at this point just replace formerly
hardwired associations, such as the implicit drop of a relation's pg_type
entry when the relation is dropped.) Need to add more logic to create
dependency entries, improve pg_dump to dump constraints in place of
indexes and triggers, and add some regression tests.
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r-- | src/backend/commands/indexcmds.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 1338f16bb59..5cf03bd11aa 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.76 2002/07/01 15:27:45 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.77 2002/07/12 18:43:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -18,6 +18,7 @@ #include "access/heapam.h" #include "catalog/catalog.h" #include "catalog/catname.h" +#include "catalog/dependency.h" #include "catalog/index.h" #include "catalog/namespace.h" #include "catalog/pg_opclass.h" @@ -68,6 +69,7 @@ DefineIndex(RangeVar *heapRelation, List *attributeList, bool unique, bool primary, + bool isconstraint, Expr *predicate, List *rangetable) { @@ -208,7 +210,7 @@ DefineIndex(RangeVar *heapRelation, index_create(relationId, indexRelationName, indexInfo, accessMethodId, classObjectId, - primary, allowSystemTableMods); + primary, isconstraint, allowSystemTableMods); /* * We update the relation's pg_class tuple even if it already has @@ -566,6 +568,7 @@ RemoveIndex(RangeVar *relation, DropBehavior behavior) { Oid indOid; HeapTuple tuple; + ObjectAddress object; indOid = RangeVarGetRelid(relation, false); tuple = SearchSysCache(RELOID, @@ -580,7 +583,11 @@ RemoveIndex(RangeVar *relation, DropBehavior behavior) ReleaseSysCache(tuple); - index_drop(indOid); + object.classId = RelOid_pg_class; + object.objectId = indOid; + object.objectSubId = 0; + + performDeletion(&object, behavior); } /* |