pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Scott Murphy <sdmurphy@pictage.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: autogenerated keys is not supported in 8.4dev-700 as specified in the changelog
Date: Fri, 03 Apr 2009 14:16:49 -0700
Message-ID: <49D67CC1.80100@ejurka.com> (raw)
In-Reply-To: <8A40010480284A7F9F26B653131E8FF5@pictageinc.com>
References: <8A40010480284A7F9F26B653131E8FF5@pictageinc.com>

Scott Murphy wrote:
> 
> The changelog for 8.4dev-700 says:
> 
> "Implement basic generated keys support."
> 
> I still get "org.postgresql.util.PSQLException: Returning autogenerated keys
> is not supported."
> 
> If I get the latest source and build it myself, it works.
> 
> Are autogenerated keys not supported in dev-700?

They are for Statements, but not PreparedStatements.  That was 
overlooked and didn't go into the -700 release, but has gone into CVS 
since then.

> Also, I noticed that the way it is written, all statements return generated
> keys.  "RETURNING" is added to all insert statements.

You should only get generated keys if you ask for them.  Apparently 
you're always asking for them or there is some kind of bug going on.

> Wouldn't it be better to let the developer add RETURNING to their SQL
> statement rather than forcing all columns back? That way if the
> developer expects generated  keys, they just need to modify their SQL.

Developers are free to completely ignore the getGeneratedKeys interface 
and write RETURNING statements themselves.  The whole point is to do it 
portably so your code works against other databases as well.

> When do you guys plan on the next dev70x release?
> 

There are no firm plans at the moment, probably another month or two.

Kris Jurka




view thread (2+ messages)

Message-ID: <49D67CC1.80100@ejurka.com>
Permalink:  ../49D67CC1.80100@ejurka.com/
Also on:    postgresql.org/message-id/49D67CC1.80100@ejurka.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, sdmurphy@pictage.com
  Subject: Re: autogenerated keys is not supported in 8.4dev-700 as specified in the changelog
  In-Reply-To: <49D67CC1.80100@ejurka.com>
  References: <8A40010480284A7F9F26B653131E8FF5@pictageinc.com> <49D67CC1.80100@ejurka.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox