Re: SERIAL behaviour - Mailing list pgsql-general

From Adrian 'Dagurashibanipal' von Bidder
Subject Re: SERIAL behaviour
Date
Msg-id 1026743373.15937.1.camel@atlas
Whole thread Raw
In response to Re: SERIAL behaviour  (Martijn van Oosterhout <kleptog@svana.org>)
List 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

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Weird (?) happenings with locks and limits?
Next
From: terry@greatgulfhomes.com
Date:
Subject: Re: help (maybe i'm a little stupid)