Re: How to get generated primary key? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: How to get generated primary key?
Date
Msg-id Pine.BSO.4.56.0502191517430.18612@leary.csoft.net
Whole thread Raw
In response to How to get generated primary key?  (Sven Köhler <skoehler@upb.de>)
Responses Re: How to get generated primary key?  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc

On Sat, 19 Feb 2005, [ISO-8859-15] Sven Köhler wrote:

> i know about the nextval and currval functions, but i don't like them,
> since they don't apply to tables. To get the generated key, you have to
> know the name of the sequence, not just the name of the table.

8.0 now offers the pg_get_serial_sequence function which may help you out.

> Does the JDBC-Driver implement the getGeneratedKeys() method?

No, see the many discussions of this in the archives, for example:

http://gborg.postgresql.org/project/pgjdbc/bugs/bugupdate.php?984

http://archives.postgresql.org/pgsql-jdbc/2004-09/msg00190.php

Kris Jurka

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: [Patch] JDBC3 Blob support
Next
From: Dave Cramer
Date:
Subject: Re: How to get generated primary key?