Re: Two rules on a view do not like each other :-(

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Two rules on a view do not like each other :-(
Дата
Msg-id 20031119171825.N1114@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Two rules on a view do not like each other :-(  (Dmitry Tkach <dmitry@openratings.com>)
Ответы Re: Two rules on a view do not like each other :-(  (Dima Tkach <dmitry@openratings.com>)
Список pgsql-general
On Wed, 19 Nov 2003, Dmitry Tkach wrote:

> rapidb=# select version ();
>                            version
> -------------------------------------------------------------
>  PostgreSQL 7.3.4 on i686-pc-linux-gnu, compiled by GCC 2.96
> (1 row)
> rapidb=# create table test (x int primary key, y int);
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> 'test_pkey' for table 'test'
> CREATE TABLE
> rapidb=# create view test_proxy as select * from test;
> CREATE VIEW
> rapidb=# create rule new_test_proxy as on insert to test_proxy do delete
> from test where x=new.x;
> CREATE RULE
> rapidb=# create rule new_test as on insert to test_proxy do instead
> insert into test values (new.x, new.y);

As a side note, you might just want to write one rule with two actions to
do this because that gets you whatever ordering you want by ordering the
actions.

В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Pg_dumpall problem
Следующее
От: Alex
Дата:
Сообщение: Export CSV from psql