pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
autogenerated keys is not supported in 8.4dev-700 as specified in the changelog
2+ messages / 2 participants
[nested] [flat]

* autogenerated keys is not supported in 8.4dev-700 as specified in the changelog
@ 2009-04-03 18:59  Scott Murphy <sdmurphy@pictage.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Scott Murphy @ 2009-04-03 18:59 UTC (permalink / raw)
  To: pgsql-jdbc

http://jdbc.postgresql.org/changes.html#version_8.4dev-700

The changelog for 8.4dev-700 says:

"Implement basic generated keys support. It does not support returning
columns by index because that requires complicated parsing of the query to
determine the table being used. Right now it supports returning all columns
and columns by name. (jurka)"

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?

Also, I noticed that the way it is written, all statements return generated
keys.  "RETURNING" is added to all insert statements.  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.

When do you guys plan on the next dev70x release?




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: autogenerated keys is not supported in 8.4dev-700 as specified in the changelog
@ 2009-04-03 21:16  Kris Jurka <books@ejurka.com>
  parent: Scott Murphy <sdmurphy@pictage.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2009-04-03 21:16 UTC (permalink / raw)
  To: Scott Murphy <sdmurphy@pictage.com>; +Cc: pgsql-jdbc

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2009-04-03 21:16 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-04-03 18:59 autogenerated keys is not supported in 8.4dev-700 as specified in the changelog Scott Murphy <sdmurphy@pictage.com>
2009-04-03 21:16 ` Kris Jurka <books@ejurka.com>

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