Re: Rule uses wrong value

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rule uses wrong value
Дата
Msg-id 2098.1097591514@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Rule uses wrong value  (Jeff Boes <jboes@qtm.net>)
Ответы Re: Rule uses wrong value  (Jeff Boes <jboes@nexcerpt.com>)
Список pgsql-general
Jeff Boes <jboes@qtm.net> writes:
> It appears that the rule is inserting the row copies into
> job_queue_trace with a job_id value that is one higher than the job_id
> from the original row. Almost as though it was re-evaluating the
> sequence ...

No kidding.  A rule is a macro and therefore has the usual risks of
multiple evaluations of arguments.

The only way to do what you want is with a trigger.

            regards, tom lane

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

Предыдущее
От: Robin Ericsson
Дата:
Сообщение: Re: query gone haywire :)
Следующее
От: Greg Stark
Дата:
Сообщение: Re: 'NOW' in UTC with no timezone