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

From: Ryan Bradetich <rbrad(at)hpb50023(dot)boi(dot)hp(dot)com>
To: 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 06:39:00
Message-ID: 199907120639.AAA06202@hpb50023.boi.hp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Wow... I actully know the answer to this question :)

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 :)

-Ryan

> I just began to learn rules with 6.5 and notice:
> test=> \dt
> Database = test
> +------------------+----------------------------------+----------+
> | Owner | Relation | Type |
> +------------------+----------------------------------+----------+
> | megera | access_log | table |
> | megera | hits | table |
> | megera | junk_qwerty | table |
> +------------------+----------------------------------+----------+
>
> test=> create rule log_hits as on update to hits do instead insert into hits
values ( NEW.msg_id, 1);
> CREATE
> test=> \dt
> Database = test
> +------------------+----------------------------------+----------+
> | Owner | Relation | Type |
> +------------------+----------------------------------+----------+
> | megera | access_log | table |
> | megera | hits | view? |
> | megera | junk_qwerty | table |
> +------------------+----------------------------------+----------+
>
> Table hits now becomes view ?
>
>
> Regards,
>
> Oleg
>
> _____________________________________________________________
> Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
> Sternberg Astronomical Institute, Moscow University (Russia)
> Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
> phone: +007(095)939-16-83, +007(095)939-23-83
>

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 1999-07-12 07:12:13 NOTICE: LockRelease: locktable lookup failed, no lock
Previous Message Gene Sokolov 1999-07-12 06:37:47 Re: [HACKERS] Re: Hashing passwords (was Updated TODO list)