From 7c6df91dda27accab3097390ef0d21d93028c7a1 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 12 Jul 2002 18:43:19 +0000 Subject: 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. --- src/backend/commands/view.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/backend/commands/view.c') diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index d27350fd467..519df157184 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -6,13 +6,14 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: view.c,v 1.65 2002/07/01 15:27:49 tgl Exp $ + * $Id: view.c,v 1.66 2002/07/12 18:43:16 tgl Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" #include "access/xact.h" +#include "catalog/dependency.h" #include "catalog/heap.h" #include "catalog/namespace.h" #include "commands/tablecmds.h" @@ -252,16 +253,21 @@ DefineView(const RangeVar *view, Query *viewParse) * RemoveView * * Remove a view given its name + * + * We just have to drop the relation; the associated rules will be + * cleaned up automatically. */ void RemoveView(const RangeVar *view, DropBehavior behavior) { Oid viewOid; + ObjectAddress object; viewOid = RangeVarGetRelid(view, false); - /* - * We just have to drop the relation; the associated rules will be - * cleaned up automatically. - */ - heap_drop_with_catalog(viewOid, allowSystemTableMods); + + object.classId = RelOid_pg_class; + object.objectId = viewOid; + object.objectSubId = 0; + + performDeletion(&object, behavior); } -- cgit v1.2.3