Re: Trigger problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Trigger problem
Дата
Msg-id 29623.1007738455@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Trigger problem  (mordicus <mordicus@free.fr>)
Список pgsql-general
mordicus <mordicus@free.fr> writes:
> Stephan Szabo wrote:
>> Wouldn't NEW.id give you the value you want rather than mucking with the
>> sequence value?

> hum, not tested but i don't think because nextval('abr_id') is the default
> value of id.

Stephan gave you the correct answer.  A trigger runs after the values
that are to be inserted into the tuple have all been computed.

You might also consider whether a BEFORE trigger would make more sense
than an AFTER trigger, if you don't want the trigger execution delayed
till end-of-statement.

            regards, tom lane

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

Предыдущее
От: Tommi Mäkitalo
Дата:
Сообщение: Database permissions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Errors: Too many open files