Re: Patch for Statement.getGeneratedKeys()

From: Ken Johanson <pg-user(at)kensystem(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Patch for Statement.getGeneratedKeys()
Date: 2008-01-15 05:38:30
Message-ID: 478C46D6.7030403@kensystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kris Jurka 2008-01-15 05:45:17 Re: Patch for Statement.getGeneratedKeys()
Previous Message Ken Johanson 2008-01-15 05:31:02 Re: Patch for Statement.getGeneratedKeys()

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2008-01-15 05:45:17 Re: Patch for Statement.getGeneratedKeys()
Previous Message Ken Johanson 2008-01-15 05:31:02 Re: Patch for Statement.getGeneratedKeys()