Re: getting back autonumber just inserted

From: PFC <lists(at)boutiquenumerique(dot)com>
To: "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "Michael Fuhr" <mike(at)fuhr(dot)org>, lmeadors(at)apache(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: getting back autonumber just inserted
Date: 2005-07-07 23:54:46
Message-ID: op.stkh1kjcth1vuj@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


>> What happens if an INSERT trigger inserts something into another
>> table which also has a sequence ?
>
> Using what, lastval()? The app will get very confused, because it'll
> get the value from the sequence used in the trigger. Using currval
> there is no problem, but you already knew that.

I knew but I forgot since I use an ORM which handles all the mess ;)

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message PFC 2005-07-07 23:56:26 Re: getting back autonumber just inserted
Previous Message Varun Mehta 2005-07-07 22:48:39 Make COUNT(*) Faster?