Re: PostgreSQL roadmap for 8.2 and beyond.

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL roadmap for 8.2 and beyond.
Date: 2005-10-17 17:43:21
Message-ID: 20051017174321.GD26773@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-10-17 17:47:22 Re: PostgreSQL roadmap for 8.2 and beyond.
Previous Message Tom Lane 2005-10-17 17:42:28 Re: libpq's pollution of application namespace