Re: PostgreSQL roadmap for 8.2 and beyond. - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: PostgreSQL roadmap for 8.2 and beyond.
Date
Msg-id 20051017174321.GD26773@svana.org
Whole thread Raw
In response to Re: PostgreSQL roadmap for 8.2 and beyond.  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: PostgreSQL roadmap for 8.2 and beyond.
List pgsql-hackers
On Mon, Oct 17, 2005 at 01:32:22PM -0400, Dave Cramer wrote:
> The JDBC problem at hand is there is a method which allows one to
> retrieve the
> autogenerated keys from an insert. I can understand Tom's argument
> here. It should
> be possible for the driver to build a query from the meta data.
>
> On the other hand given that all of the serial increments are stored
> in the session is it possible to
> get the results of the last insert on the session ? If we can avoid
> the extra query so much
> the better, but either way is better than what we have ?

ISTM them that the RETURNING patch as given solves your problem nicely.
You don't even have to know the name of the sequence, just the name of
the primary key column. When you see an INSERT append "RETURNING
colname" and you have your answer.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: PostgreSQL roadmap for 8.2 and beyond.
Next
From: Dave Cramer
Date:
Subject: Re: PostgreSQL roadmap for 8.2 and beyond.