Re: SERIAL behaviour

From: Adrian 'Dagurashibanipal' von Bidder <avbidder(at)fortytwo(dot)ch>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SERIAL behaviour
Date: 2002-07-15 14:29:33
Message-ID: 1026743373.15937.1.camel@atlas
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2002-07-15 at 16:07, Martijn van Oosterhout wrote:
> On Mon, Jul 15, 2002 at 03:47:28PM +0200, Adrian 'Dagurashibanipal' von Bidder wrote:
> > On Sun, 2002-07-14 at 03:59, Eugene wrote:
> > [ SERIAL type / SEQUENCEs and transactions ]
> >
> > Closely related: what's the official/preferred way if I'm inserting rows
> > into a table with a auto assigned id (SERIAL), to get the newly created
> > id? asking the sequence obviously will not work - as the sequence will
> > advance when the next value is inserted from another transaction.
>
> You read the documentation and notice that currval() is not affected by
> nextval()s executed upon other connections. In other words, it's a complete
> non-issue and works exectly the way that is useful.

Ok, thanks (and sorry for not rtfm in this case). Unexpected, but, yes,
useful.

cheers
-- vbi

--
secure email with gpg http://fortytwo.ch/gpg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message terry 2002-07-15 14:42:02 Re: help (maybe i'm a little stupid)
Previous Message Tom Lane 2002-07-15 14:19:43 Re: Weird (?) happenings with locks and limits?