Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 6FF2A1C0B197 for ; Fri, 20 Jul 2012 06:27:10 -0300 (ADT) Received: from moutng.kundenserver.de ([212.227.17.8]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ss9UK-0001pV-6g for pgsql-jdbc@postgresql.org; Fri, 20 Jul 2012 09:27:10 +0000 Received: from tbz-emx-mobil.localnet ([85.183.3.43]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Lkism-1TSaEN1RPI-00awxx; Fri, 20 Jul 2012 11:26:55 +0200 From: "ml-tb" Reply-To: ml-tb@emagixx.de To: pgsql-jdbc@postgresql.org Subject: Re: not fetching all query results Date: Fri, 20 Jul 2012 11:26:53 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32-5-amd64; KDE/4.4.5; x86_64; ; ) References: <50044D96.3050902@filez.com> <5005D257.9000100@filez.com> <5008E9AC.8030507@ringerc.id.au> In-Reply-To: <5008E9AC.8030507@ringerc.id.au> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201207201126.53950.ml-tb@emagixx.de> X-Provags-ID: V02:K0:WqUj1wMNEnvZW98/2pIFy7pL99k7eoHcjKejX1ytT9y rpR+l+q9FZJb/3tPRmBJh23pQEDdMv/j/pvTc/xasnvm2ts0SR qu5VRf+mRPZhD2dSB09D+88AJUmv4xzrYcmj7f0JDdWtHtpHTW ffakP8Tc87rjpfn3udVAqTxvsgE20rbisczy1Kdz7CcWFn6WJE YKW1xJLcXpA/YFmOQ/6VxbgSHpai0hMhZjCQA5R77479y0jvEs UxjpBkJguBZl7FSVHd1KcKMS+5JDNyurd0rDzctEuxnxK6jKHm tUpDslm+oT66qYFUr4/pRAVJHKv3H4rNFhYK2jofh+v5Ku/TWa 3A+BxTrpjEOryj6qhTLpOW8/rRTgBtJcYE7ddYQBK X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/36 X-Sequence-Number: 23134 Am Freitag, 20. Juli 2012 schrieb Craig Ringer: > 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 > >> http://jdbc.postgresql.org/documentation/91/query.html#fetchsize-e > >> xample > >> > >> 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/QueryExecutorImpl.java 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 certificates. Perhaps the the original poster is helped with a modified URL, that set the fetch size default != 0. We have the same issue here, plus that the used framework resets connections to default values (why ever ...). So we modified the possibilities of the driver URL: fixDefaults (true/false; default: false) defaultFetchSize (int, default: 0) defaultAutoCommit (true/false; default: true) > 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: > > http://jdbc.postgresql.org/development/git.html > > and there's developer info here: > > http://jdbc.postgresql.org/development/intro.html > > 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. This is obviously true :-) Bye Thomas