Re: getGeneratedKeys()

From: Kris Jurka <books(at)ejurka(dot)com>
To: Henrik Andersson <henr-and(at)dsv(dot)su(dot)se>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: getGeneratedKeys()
Date: 2003-12-30 20:30:03
Message-ID: Pine.LNX.4.33.0312301523060.5331-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 30 Dec 2003, Henrik Andersson wrote:

> Is getGeneratedKeys() implemented? I am using the package in Debian
> Unstable but I am getting: "org.postgresql.util.PSQLException: This
> method is not yet implemented."

This method has not been implemented and most likely will not be
implemented anytime soon. First it is unclear to me what it means by
auto-generated keys. Does it mean just things like serial or anything
that a before insert trigger does to modify the row? Secondly what comes
back in the ResultSet? Just the generated keys? How is that useful
without anything to tie it to? Finally the real problem is that the
backend has no way of reporting this information to us. Possibly for a
single insert we could do a getLastOID() and assume it was unique in the
table to look it up, but this is obviously fragile in the presence of
duplicate oids, tables without oids, anything other than insert
statements, and statements that operate on more than one row.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message henr-and 2003-12-30 21:55:22 Re: getGeneratedKeys()
Previous Message Nic Ferrier 2003-12-30 19:57:44 Re: Multi-threaded servlet environment