Re: Trigger problem

Поиск
Список
Период
Сортировка
От mordicus
Тема Re: Trigger problem
Дата
Msg-id 9upqlo$126l$1@news.tht.net
обсуждение исходный текст
Ответ на Re: Trigger problem  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: Trigger problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Trigger problem  (Jan Wieck <janwieck@yahoo.com>)
Список pgsql-general
Stephan Szabo wrote:

> On Thu, 6 Dec 2001, mordicus wrote:
>
>> So, if i do
>>
>> insert into abreviations(smot,mot,abreviation,pays) select
>> smot,mot,abreviation,pays from a;
>>
>> the Trigger is executed for each row ONLY after all rows have been
>> inserted, so the
>> "   id    := currval(''abr_id'');"
>> in my trigger have false value (always the last value after 53000 insert
>> ...)
>
> 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.


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

Предыдущее
От: Holger Krug
Дата:
Сообщение: Re: Using Cursor in PostgreSQL 7.2
Следующее
От: Alexey Borzov
Дата:
Сообщение: upgrade 7.1.3 -> 7.2b3 - a problem with pl/pgsql