Skip site navigation (1) Skip section navigation (2)

Re: Serial key

From: Kris Jurka <books(at)ejurka(dot)com>
To: John Sidney-Woollett <johnsw(at)wardbrook(dot)com>
Cc: Chris Smith <cdsmith(at)twu(dot)net>,Bhushan Bhangale <bbhangale(at)lastminute(dot)com>,<pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Serial key
Date: 2004-02-13 18:39:44
Message-ID: Pine.LNX.4.33.0402131333390.23705-100000@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

On Fri, 13 Feb 2004, John Sidney-Woollett wrote:

> Alternatively, if you could use a sequence object for the primary key
> value (instead of a serial column), and you switched autocommit off, you
> should be able to determine the last allocated PK id AFTER creating the
> record by querying the currval on the sequence.
>

autocommit has nothing to do with this, sequence state via currval is
session specific, not transaction specific.

Kris Jurka


In response to

Responses

pgsql-jdbc by date

Next:From: Dave CramerDate: 2004-02-13 18:53:14
Subject: Re: Serial key
Previous:From: Kris JurkaDate: 2004-02-13 18:33:24
Subject: Re: Startup message issues

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group