Re: Trigger problem

From: mordicus <mordicus(at)free(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger problem
Date: 2001-12-07 09:20:31
Message-ID: 9upqlo$126l$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretzer 2001-12-07 09:44:04 Re: C interface libpq.so.2 problem
Previous Message Alexey Borzov 2001-12-07 08:23:15 upgrade 7.1.3 -> 7.2b3 - a problem with pl/pgsql