Re: PostgreSQL roadmap for 8.2 and beyond.

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: PostgreSQL roadmap for 8.2 and beyond.
Дата
Msg-id 20051017174321.GD26773@svana.org
обсуждение исходный текст
Ответ на Re: PostgreSQL roadmap for 8.2 and beyond.  (Dave Cramer <pg@fastcrypt.com>)
Ответы Re: PostgreSQL roadmap for 8.2 and beyond.  (Dave Cramer <pg@fastcrypt.com>)
Список 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 по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: PostgreSQL roadmap for 8.2 and beyond.
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: PostgreSQL roadmap for 8.2 and beyond.