Re: [HACKERS] create rule changes table to view ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ryan Bradetich <rbrad(at)hpb50023(dot)boi(dot)hp(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org, oleg(at)sai(dot)msu(dot)su
Subject: Re: [HACKERS] create rule changes table to view ?
Date: 1999-07-12 15:00:44
Message-ID: 20212.931791644@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ryan Bradetich <rbrad(at)hpb50023(dot)boi(dot)hp(dot)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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-07-12 15:12:31 Re: [HACKERS] 6.5.1 release date
Previous Message Tom Lane 1999-07-12 14:53:26 Re: [HACKERS] 6.5.1 release date