Tom,

The little bit of investigation I've done leads me to belive I can determine the 
difference between a table and a view, because they are correctly seperated in 
pg_views and pg_tables. I'll do some more research and see if I can actually do 
this, or if you and Jan are right :)

Thanks,
- Ryan


> 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

Mon, 12 Jul 1999 09:21:33 -0600 (MDT)
Ryan Bradetich <rbrad@hpb50023.boi.hp.com>
Re: [HACKERS] create rule changes table to view ?