mordicus <mordicus(at)free(dot)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