On 17-Oct-05, at 1:43 PM, Martijn van Oosterhout wrote:
> 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.
Well, the driver still needs to know ahead of time which columns are
going to be autogenerated.
Dave
>
> 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.
>