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

Re: How to get generated primary key?

From: Kris Jurka <books(at)ejurka(dot)com>
To: Sven Köhler <skoehler(at)upb(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: How to get generated primary key?
Date: 2005-02-19 20:21:42
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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:

Kris Jurka

In response to


pgsql-jdbc by date

Next:From: Michael BarkerDate: 2005-02-20 01:58:14
Subject: [Patch] JDBC3 Blob support
Previous:From: Kris JurkaDate: 2005-02-19 20:15:29
Subject: Re: [Patch] JDBC3 Blob support

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