Re: BUG #1988: keygen not implemented

From: "Mike Clements" <mclements(at)actional(dot)com>
To: "Oliver Jowett" <oliver(at)opencloud(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #1988: keygen not implemented
Date: 2005-10-23 21:55:43
Message-ID: 06B12D1D68BCCA4CB1F60BB4EA509768245260@pq-exch01.actional.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks for the info. I found a workaround by selecting the current value of the sequence after doing the insert. This however is not desirable since it requires another round trip call to the DB, and it requires PostGRE SQL specific code in my "generic" JDBC client. If the driver supported getGeneratedKeys(), client applications could perform better and be truly generic.

Also looking at the release notes I see I'm not the only person asking for this feature... Good luck.

> -----Original Message-----
> From: Oliver Jowett [mailto:oliver(at)opencloud(dot)com]
> Sent: Sunday, October 23, 2005 2:24 PM
> To: Mike Clements
> Cc: pgsql-bugs(at)postgresql(dot)org
> Subject: Re: [BUGS] BUG #1988: keygen not implemented
>
> Mike Clements wrote:
>
> > Insert a row into the table using:
> > Connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
> > The driver throws an exception saying this method is not
> yet implemented.
>
> This is an optional part of the JDBC spec, and the driver
> doesn't claim
> to support it in the metadata it provides
> (DatabaseMetaData.supportsGetGeneratedKeys() returns false).
>
> > What it should do is create the prepared statement so when
> you execute it,
> > the returned ResultSet has the generated primary key.
>
> Unfortunately this requires functionality in the backend that
> does not
> yet exist (support for "INSERT .. RETURNING ...", or similar).
>
> -O
>
>

Browse pgsql-bugs by date

  From Date Subject
Next Message Paul Anderson 2005-10-24 00:21:50 BUG #1992: ODBC error with PostgreSQL Win32 Clients
Previous Message Oliver Jowett 2005-10-23 21:23:35 Re: BUG #1988: keygen not implemented