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

Re: not fetching all query results

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Radim Kolar <hsn(at)filez(dot)com>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: not fetching all query results
Date: 2012-07-20 05:16:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
On 07/18/2012 05:00 AM, Radim Kolar wrote:
> Dne 17.7.2012 22:05, Dave Cramer napsal(a):
>> Radim,
>> As per our docs
>> You need to do the select inside a transaction
> In transaction that simple example really works. Can it be fixed in 
> driver to work in autocommit mode? I will try scrollable cursor next.

I haven't looked into how the fetch size code works to see whether it's 
possible for it to operate in autocommit. A quick look at 
QueryExecutorImpl.sendOneQuery in 
org/postgresql/core/v3/ finds the line:

   boolean usePortal = (flags & QueryExecutor.QUERY_FORWARD_CURSOR) != 0 
&& !noResults && !noMeta && fetchSize > 0 && !describeOnly;

given that and the subsequent code I don't understand why an explicit 
transaction is required. I've only done a tiny bit with the JDBC code, 
though, and only related to the authentication system and client 

My rather blunt comment to you at the start of this thread was to point 
out that JDBC driver development doesn't just happen. It's a volunteer 
effort; people put their own time into this. Something like

     "It should not be that difficult to get it fixed. I am not 
interested in workarounds"

is pretty dismissive of the work you're already getting for free and 
without having contributed to it in any way. If you don't like it, one 
of your options is to do something about it yourself. The PgJDBC driver 
is open source, so rather than just asserting it can't be that 
difficult, you have the opportunity to prove your assertion by producing 
a patch that fixes your problem. Demanding that others spend their time 
fixing a problem you care about is a bit rude.

You can check the sources out here:

and there's developer info here:

If you approach this with a the attitude of "this is causing a problem 
for me and I would love some help fixing it, any suggestions where I 
should start" you will probably get better results.

Craig Ringer

In response to


pgsql-jdbc by date

Next:From: Kris JurkaDate: 2012-07-20 05:44:02
Subject: Re: not fetching all query results
Previous:From: Radim KolarDate: 2012-07-17 21:00:07
Subject: Re: not fetching all query results

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