Re: when does CREATE VIEW not create a view? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: when does CREATE VIEW not create a view?
Date
Msg-id 13777.967588707@sss.pgh.pa.us
Whole thread Raw
In response to Re: when does CREATE VIEW not create a view?  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
List pgsql-hackers
"Ross J. Reedstrom" <reedstrm@rice.edu> writes:
> Only problem is in utils/adt/ruleutils.c

> There's code in there that constructs potential rule names that start with
> '_ret' as well as '_RET', in order to use an SPI query to find the rule
> associated with a view. This is the only occurance of the string '"_ret'
> in the codebase, and I can't find a way a rule might get that name, nor an
> example in either the 6.5.0 and 7.0.2 databases I've got here.  

Most likely it's dead code.  I'd say simplify.

Mark Hollomon's question about adding a relisview column to pg_class
spurs another possibility: add a column to pg_class, but instead of
just a boolean, make it be 0 if not a view and the OID of the view rule
if it is.  That'd get rid of the dependency on rule names altogether
for code that needs to find the associated rule.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Martin A. Marques"
Date:
Subject: new in list
Next
From: Alfred Perlstein
Date:
Subject: Re: disallow LOCK on a view - the Tom Lane remix