"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