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 по дате отправления:

Предыдущее
От: Florian Wunderlich
Дата:
Сообщение: Re: BUG #3932: utf-8 and upper()/lower(): PANIC: ERRORDATA_STACK_SIZE exceeded
Следующее
От: "irfin"
Дата:
Сообщение: BUG #3933: Update problem for 3 Foreign Keys referencing 1 field in another table (I'm not newbie in using SQL)