Re: [HACKERS] create rule changes table to view ? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] create rule changes table to view ?
Date
Msg-id 20212.931791644@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] create rule changes table to view ?  (Ryan Bradetich <rbrad@hpb50023.boi.hp.com>)
Responses Re: [HACKERS] create rule changes table to view ?
Re: [HACKERS] create rule changes table to view ?
List pgsql-hackers
Ryan Bradetich <rbrad@hpb50023.boi.hp.com> writes:
> psql declares the the type to be view? if the relkind is a relation
> and the relhasrules = true in pg_class for that entry.  I will pull
> the latest source and see if I can come up with a better way for
> determining the type tomorrow, if someone else doesn't beat me to it

The way Jan explained it to me, a view *is* a table that happens to
have an "on select do instead" rule attached to it.  If the table
has data in it (which it normally wouldn't) you can't see that data
anyway because of the select rule.

This is another example like SERIAL columns, UNIQUE columns, etc, where
we are not really leaving enough information in the system tables to
allow accurate reconstruction of what the user originally said.  Was
it a CREATE VIEW, or a CREATE TABLE and manual attachment of a rule?
No way to tell.  In one sense it doesn't matter a whole lot, but for
psql displays and pg_dump it would be nice to know what happened.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] 6.5.1 release date
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] 6.5.1 release date