Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-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

pgsql-jdbc by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group