Re: NEW in Rule makes another nextval call?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: NEW in Rule makes another nextval call?
Дата
Msg-id 4357AAFD.8070902@archonet.com
обсуждение исходный текст
Ответ на Re: NEW in Rule makes another nextval call?  (Sven Willenberger <sven@dmv.com>)
Список pgsql-general
Sven Willenberger wrote:
> On Thu, 2005-10-20 at 15:01 +0100, Richard Huxton wrote:
>>However, in this particular case I think you want an after insert
>>trigger on customer rather than a rule.
>
> As as AFTER INSERT trigger, I can safely assume here that NEW.custid wil
> now properly use the actual value of the custid rather than nextval()? I
> have dropped the rule and created the AFTER INSERT trigger so I guess I
> will find out shortly enough :-)

An AFTER TRIGGER does nothing to the plan-tree, it just calls a function
once per row (for a per-row trigger). You have two structures (NEW,OLD)
with ordinary values in them.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Sven Willenberger
Дата:
Сообщение: Re: NEW in Rule makes another nextval call?
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: NULL != text ?