Philip Warner <pjw@rhyme.com.au> writes:
> I don't suppose we can change the pg_views view without an initdb?
No, not very readily.
Even assuming that we were willing to require dbadmins to run a script
during upgrade (which I wouldn't want to do unless forced to it), it's
not that easy to fix all the occurrences of a system view. Remember
there will be a separate copy in each database, including template0
which you can't even get to. On top of which, DROP VIEW/CREATE VIEW
wouldn't work because the view would then have the wrong OID, and would
look like a user-created object to pg_dump. You'd have to manually
manipulate tuples in pg_class, pg_attribute, pg_rewrite, etc.
Kluging pg_dump is a *lot* cleaner.
I agree with the idea of adding the rule OID as a new column of pg_views
for 7.2, however.
regards, tom lane