Re: [GENERAL] getting the currval of a sequence

From: James Olin Oden <joden(at)lee(dot)k12(dot)nc(dot)us>
To: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>, "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] getting the currval of a sequence
Date: 1998-08-14 14:48:19
Message-ID: 81Aug13.093651edt.35713@gateway.lee.k12.nc.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I think you should just go with what Vadim suggested and use:
> select currval('my_sequence');
> This will be the same within a transaction, even if there is another
> transaction using the same sequence.

Sorry, I wasn't thinking of it happening in the same transaction. In that
case that would be the thing to do. If on the other hand you needed that
number over multiple transactions, wouldn't what I had suggested work?

...james

>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jackson, DeJuan 1998-08-14 15:05:15 RE: [GENERAL] getting the currval of a sequence
Previous Message Jackson, DeJuan 1998-08-14 14:39:12 RE: [GENERAL] getting the currval of a sequence