Re: [GENERAL] get the previous assigned sequence value

1999-12-09 Thread Ed Loehr
"Ross J. Reedstrom" wrote: > Gah, this is getting a bit annoying, correcting this bit of > mis-information. > > currval() is kept as part of the session context, as is completely > multi-user safe. That's why the person you quoted said 'in the same > session'. > > Where is everyone coming up with

Re: [GENERAL] get the previous assigned sequence value

1999-12-09 Thread Ross J. Reedstrom
Gah, this is getting a bit annoying, correcting this bit of mis-information. currval() is kept as part of the session context, as is completely multi-user safe. That's why the person you quoted said 'in the same session'. Where is everyone coming up with the wrong idea on this? Is there a major

Re: [GENERAL] get the previous assigned sequence value

1999-12-09 Thread Nikolay Mijaylov
--- The reboots are for hardware upgrades! "http://www.nmmm.nu; <[EMAIL PROTECTED]> - Original Message - From: Adriaan Joubert <[EMAIL PROTECTED]> Cc: Dev Elop <[EMAIL PROTECTED]>; pgsql-general <[EMAIL PROTECTED]> Sent: 09 Äåêåìâðè 1

Re: [GENERAL] get the previous assigned sequence value

1999-12-09 Thread Adriaan Joubert
> > With this second method, you'd probably need to beware race conditions. If > > another process inserts a record into mytable after you do but before you > > call currval(), then you'll get the wrong value. > > > > Not an issue if you've only got one process accessing the table - probably > > i

Re: [GENERAL] get the previous assigned sequence value

1999-12-09 Thread Stuart Rison
On Thu, 9 Dec 1999, Dev Elop wrote: > > > > > > After an INSERT, I want to retrieve the value of the sequence I use for > > > unique_ids > > > > ... > > > > Alternatively, use the currval(mytable_id_seq) function within the same > > session immediately after the insert. > > > With this second met

Re: [GENERAL] get the previous assigned sequence value

1999-12-09 Thread Dev Elop
> > > > After an INSERT, I want to retrieve the value of the sequence I use for > > unique_ids > > ... > > Alternatively, use the currval(mytable_id_seq) function within the same > session immediately after the insert. > With this second method, you'd probably need to beware race conditions. If an

Re: [GENERAL] get the previous assigned sequence value

1999-12-08 Thread Ed Loehr
Kevin Heflin wrote: > I've been looking through the online docs, so far have not found this > information. > > After an INSERT, I want to retrieve the value of the sequence I use for > unique_ids > > Any suggestions ? Use the OID returned from the INSERT to select the newly created value, i.e.,