From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Dave Cramer <pg(at)fastcrypt(dot)com> |
Cc: | 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 15:54:48 |
Message-ID: | 20051017155447.GA26773@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Oct 17, 2005 at 09:12:35AM -0400, Dave Cramer wrote:
> I fail to see how this solves the problem of getting auto generated
> keys.
>
> AFAIKS, the protocol needs to be tweaked to return at a minimum the
> currval for the first serial in the row, but more correctly all of
> the modified currval's for an insert
In what sense? It seems to do exactly what you want. The example in the
documentation is:
INSERT INTO films (title) VALUES ('Yojimbo') RETURNING film_id;
film_id
---------
123
The protocol allows you to return a result set for any command already
so I don't think there's any protocol changes at all. You don't even
need to know the name of the sequence which is something I wasn't even
hoping for. Well done...
> if we had that then we could correctly implement getAutoGeneratedKeys
> for jdbc.
There is a function now to return the sequence associated with a table
so I think this would be quite straightforward actually, assuming you
know the table being operated on.
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.
From | Date | Subject | |
---|---|---|---|
Next Message | Marc Munro | 2005-10-17 15:58:33 | Re: dynamic loading of .so (originally from pgsql-general) |
Previous Message | Kevin McArthur | 2005-10-17 15:52:39 | Re: PostgreSQL roadmap for 8.2 and beyond. |