Skip to content

Commit 3513f4d

Browse files
committed
RemoveView was doing things the hard way...
1 parent b41f4ab commit 3513f4d

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/backend/commands/view.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: view.c,v 1.43 2000/06/12 19:40:40 momjian Exp $
9+
* $Id: view.c,v 1.44 2000/06/30 07:06:05 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -109,7 +109,6 @@ DefineVirtualRelation(char *relname, List *tlist)
109109
*
110110
* Given a view name, returns the name for the 'on retrieve to "view"'
111111
* rule.
112-
* This routine is called when defining/removing a view.
113112
*------------------------------------------------------------------
114113
*/
115114
char *
@@ -293,22 +292,9 @@ DefineView(char *viewName, Query *viewParse)
293292
void
294293
RemoveView(char *viewName)
295294
{
296-
char *rname;
297-
298-
/*
299-
* first remove all the "view" rules... Currently we only have one!
300-
*/
301-
rname = MakeRetrieveViewRuleName(viewName);
302-
RemoveRewriteRule(rname);
303-
304-
/*
305-
* we don't really need that, but just in case...
306-
*/
307-
CommandCounterIncrement();
308-
309295
/*
310-
* now remove the relation.
296+
* We just have to drop the relation; the associated rules will
297+
* be cleaned up automatically.
311298
*/
312299
heap_drop_with_catalog(viewName);
313-
pfree(rname);
314300
}

0 commit comments

Comments
 (0)