Re: idea: storing view source in system catalogs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: idea: storing view source in system catalogs
Date
Msg-id 7079.1211324325@sss.pgh.pa.us
Whole thread Raw
In response to idea: storing view source in system catalogs  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-hackers
"Merlin Moncure" <mmoncure@gmail.com> writes:
> I wonder if there is any merit to the idea of storing the 'create
> view' statement that created the view in an appropriate place.

No, there isn't.

As counterexamples look at pg_constraint.consrc and pg_attrdef.adsrc,
both of which were mistakes from the day they were put in, and have
been deprecated for a long time.  Source doesn't have any reasonable
way to track table/column renames, to point out one problem.

> If I do:
> create view v as select * from foo;

> The view definition as understood by the database expands the column
> list.

Indeed, exactly as is *required* by the SQL spec.
        regards, tom lane


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: idea: storing view source in system catalogs
Next
From: Florian Pflug
Date:
Subject: Re: idea: storing view source in system catalogs