Re: Patch for Statement.getGeneratedKeys() - Mailing list pgsql-jdbc

From Ken Johanson
Subject Re: Patch for Statement.getGeneratedKeys()
Date
Msg-id 478C46D6.7030403@kensystem.com
Whole thread Raw
In response to Re: Patch for Statement.getGeneratedKeys()  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
>> What are your thoughts on this? Should it be possible/safe going
>> forward to not supply the fully qualified table in the case of:
>>
>> Statement.executeUpdate(String sql, int columnIndexes[])
>>
>> If you can recommend a simpler strategy I will try it. If we can avoid
>> the round trip also that would be great.
>>
>
> Writing "RETURNING *" will return more data than you need, but it has
> the plus of not requiring you to know anything about the underlying
> table columns.  Once the full result is returned you would need to strip
> out only the parts specified in columnIndexes and either create a new
> ResultSet or a wrapper around the returned ResultSet.
>

"RETURNING *" is indeed simpler although based on on real word
experience on slow/congested links or hi transaction volume, and use
cases with large inserts (multi-row, many columns, or LOBs) (
memory/scalability issues), the round trip seems to preferable. I'd
rather muddle though getting that to work (I did already and code to
follow) instead of risking more serious performance issues, if you don't
object.

Ken



pgsql-jdbc by date:

Previous
From: Ken Johanson
Date:
Subject: Re: Patch for Statement.getGeneratedKeys()
Next
From: Kris Jurka
Date:
Subject: Re: Patch for Statement.getGeneratedKeys()