Re: getGeneratedKeys() - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: getGeneratedKeys()
Date
Msg-id Pine.LNX.4.33.0312301523060.5331-100000@leary.csoft.net
Whole thread Raw
In response to getGeneratedKeys()  (Henrik Andersson <henr-and@dsv.su.se>)
Responses Re: getGeneratedKeys()  (<henr-and@dsv.su.se>)
List 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



pgsql-jdbc by date:

Previous
From: Nic Ferrier
Date:
Subject: Re: Multi-threaded servlet environment
Next
From:
Date:
Subject: Re: getGeneratedKeys()