Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C83C9633554 for ; Thu, 15 Apr 2010 19:02:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 56250-01-5 for ; Thu, 15 Apr 2010 22:02:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f228.google.com (mail-bw0-f228.google.com [209.85.218.228]) by mail.postgresql.org (Postfix) with ESMTP id 72B2663344F for ; Thu, 15 Apr 2010 19:01:59 -0300 (ADT) Received: by bwz28 with SMTP id 28so2095261bwz.34 for ; Thu, 15 Apr 2010 15:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=PoPb1rSk1BzCPufC07I777HPwCioPo5yVVNIsSHUuOg=; b=J1qBJw83q7tzXYlEEtjQKhMg0m2NxFE1LeQ9XilE/H+7AdaYdMegaYwG/c3lAl/E6R 5fQxYURuvWo837YmNEW70b4EXaEuSk8DBg6io/tGIF2qQfZ4UqZqXLsmuCaBwR1fE2ze OngJYRd2EQkvuDsZO599Z0tRvl2w8zQFXyfxg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=uapemzz2Jz5SeknUlnb7wD7BjSDNhvZdl/R0PGgKnJSgsbe30aUUpgw8ay4uukXOHY 0NwUkoyGLfWMUNCj5P+tEeNmBVGDWbIEqHEEDEnDCllCGaWfWvCCNqFu4BCAKlF1dY7N Zs02hYhOF0dBpAcstSNWEJaILzvKAiceX4eAs= MIME-Version: 1.0 Received: by 10.204.66.8 with HTTP; Thu, 15 Apr 2010 15:01:54 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Apr 2010 17:01:54 -0500 Received: by 10.204.81.145 with SMTP id x17mr832512bkk.31.1271368914923; Thu, 15 Apr 2010 15:01:54 -0700 (PDT) Message-ID: Subject: Re: HELP: How to tame the 8.3.x JDBC driver with a biq query result set From: Dave Crooke To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016e6d99d008df1e604844da418 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201004/23 X-Sequence-Number: 20434 --0016e6d99d008df1e604844da418 Content-Type: text/plain; charset=UTF-8 But it's a SELECT, albeit I am doing the write transactions from another statement on the same connection ... if I use two connections, will that fix it? Cheers Dave On Thu, Apr 15, 2010 at 3:22 PM, Kris Jurka wrote: > > > On Thu, 15 Apr 2010, Dave Crooke wrote: > > I have a huge table I need to do a full table scan on. >> >> 2. When I use setFetchSize(), which is both a JDBC standard and the >> recommendation on the page below ... >> >> http://jdbc.postgresql.org/documentation/83/query.html#query-with-cursor >> >> ... it bails after about 900ms / 100 fetches / a few thousand rows, with >> the >> following PG internal error: >> >> org.postgresql.util.PSQLException: ERROR: portal "C_14" does not exist >> >> > I'm guessing that you have committed the transaction so the portal (backing > the query) gets cleaned up. To keep a portal open across transactions you > need the WITH HOLD option to DECLARE CURSOR. There is no way to do that at > the protocol level to work with the current query setup you have. If that's > what you need, you'll need to rewrite it to DECLARE CURSOR and then issue > the FETCHes yourself. > > Kris Jurka > --0016e6d99d008df1e604844da418 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable But it's a SELECT, albeit I am doing the write transactions from anothe= r statement on the same connection ... if I use two connections, will that = fix it?

Cheers
Dave

On Thu, Apr= 15, 2010 at 3:22 PM, Kris Jurka <books@ejurka.com> wrote:


On Thu, 15 Apr 2010, Dave Crooke wrote:

I have a huge table I need to do a full table scan on.

2. When I use setFetchSize(), which is both a JDBC standard and the
recommendation on the page below ...

http://jdbc.postgresql.org/documentation/83/que= ry.html#query-with-cursor

... it bails after about 900ms / 100 fetches / a few thousand rows, with th= e
following PG internal error:

org.postgresql.util.PSQLException: ERROR: portal "C_14" does not = exist


I'm guessing that you have committed the transaction so the portal (bac= king the query) gets cleaned up. =C2=A0To keep a portal open across transac= tions you need the WITH HOLD option to DECLARE CURSOR. =C2=A0There is no wa= y to do that at the protocol level to work with the current query setup you= have. =C2=A0If that's what you need, you'll need to rewrite it to = DECLARE CURSOR and then issue the FETCHes yourself.

Kris Jurka

--0016e6d99d008df1e604844da418--