rule on insert

Поиск
Список
Период
Сортировка
От Razvan Radu
Тема rule on insert
Дата
Msg-id 001101c04026$aaf2aee0$0101a8c0@digiview.ro
обсуждение исходный текст
Ответ на Re: Postgres 7.0.2-2 on Red Hat 7.0?  ("Adam Lang" <aalang@rutgersinsurance.com>)
Список pgsql-general
hello,

I have a problem with a rule "on insert"

I have a table "my_table" with a field named "index"
that has a default value of "nextval('seq')"

and the folowing rule
------------------------------------------------------
CREATE RULE log_ins AS ON INSERT TO my_table
DO INSERT INTO log(tbl,idrow,query,time)
VALUES('my_table',NEW.index,'INSERT','now'::text) ;
-----------------------------------------------------

my problem is:

in "log" table I have for "NEW.index" a value of 13
amd in "my_table" I have for "NEW.index" a value of 14
always (+1) which is the increment of sequence "seq"

can someone help me ?

P.S. what is the suntax for multiple actions in a rule ?

-razvan-



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: What is the listserver at hub.org doing?
Следующее
От: Ian Lance Taylor
Дата:
Сообщение: Re: What is the listserver at hub.org doing?