Re: BUG #3929: RULE causes unintended update of SEQUENCE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #3929: RULE causes unintended update of SEQUENCE
Дата
Msg-id 23074.1202230826@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #3929: RULE causes unintended update of SEQUENCE  ("Arjan Tuinhout" <at@tuko.nl>)
Список pgsql-bugs
"Arjan Tuinhout" <at@tuko.nl> writes:
> -- However the intended code does not work: appearantly the SEQUENCE is
> update by calling the RULE; proofed by the workaround.

This is the expected behavior with a rule --- it's a macro, so multiple
references to the same input value risk multiple evaluations.

> -- Please help. Thanx. Arjan.

Use a trigger instead when your intent is to copy data from the
inserted/updated row to someplace else.

            regards, tom lane

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