pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Dave Crooke <dcrooke@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: HELP: How to tame the 8.3.x JDBC driver with a biq query result set
Date: Thu, 15 Apr 2010 16:22:27 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1004151616310.9994@leary.csoft.net> (raw)
In-Reply-To: <t2gca24673e1004151313x66d090c6q36193d18f4ec2d67@mail.gmail.com>
References: <t2gca24673e1004151313x66d090c6q36193d18f4ec2d67@mail.gmail.com>



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



view thread (4+ messages)  latest in thread

Message-ID: <alpine.BSO.2.00.1004151616310.9994@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.1004151616310.9994@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.1004151616310.9994@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, dcrooke@gmail.com
  Subject: Re: HELP: How to tame the 8.3.x JDBC driver with a biq query result set
  In-Reply-To: <alpine.BSO.2.00.1004151616310.9994@leary.csoft.net>
  References: <t2gca24673e1004151313x66d090c6q36193d18f4ec2d67@mail.gmail.com> <alpine.BSO.2.00.1004151616310.9994@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox