| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера