"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