Re: getting back autonumber just inserted - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: getting back autonumber just inserted
Date
Msg-id 20050708014950.GA3339@winnie.fuhr.org
Whole thread Raw
In response to Re: getting back autonumber just inserted  (PFC <lists@boutiquenumerique.com>)
Responses Re: getting back autonumber just inserted
Re: getting back autonumber just inserted
List pgsql-sql
On Fri, Jul 08, 2005 at 01:56:26AM +0200, PFC wrote:
> >Do you mean with lastval()?  Here's what happens:
> 
> Hm, interesting, you mean the return value of lastval() also depends 
> if  you set your constraints  to deferred or immediate ?

My mind's ablank trying to contrive a situation where that would
matter.  Can you provide an example?

In any case, I simply meant to point out that 8.1's lastval() will
be seductively convenient because you don't have to pass it a
sequence name, but the value it returns might not be the value you
want.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


pgsql-sql by date:

Previous
From: PFC
Date:
Subject: Re: getting back autonumber just inserted
Next
From: Michael Fuhr
Date:
Subject: Re: Make COUNT(*) Faster?