On 27 October 2011 12:18, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Bottom line from a server-side point of view is that if you want that
> overhead, you can ask for it, by opening a held cursor. It might be
> sensible for JDBC to provide that functionality with something that
> looks as much as possible like an ordinary resultset --- but I'm pretty
> certain it shouldn't be the default behavior on the JDBC side either.
We'd only do this if HOLD_CURSORS_OVER_COMMIT (which isn't the
default) was explicitly set on the resultset.
It really would be useful to specify something equivalent to WITH HOLD
on a portal though - trying to work out how to transform an arbitrary
query into a DECLARE CURSOR is the sort of SQL mangling the driver
tries to avoid doing. (It did exactly that back in the 7.3 / protocol
version 2 days and there were all sorts of nasty edge cases)
Oliver