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

Re: Cursor returned from procedure ignores setFetchSize() on

From: Kris Jurka <books(at)ejurka(dot)com>
To: "Brian G(dot) Huber" <brianghuber(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Cursor returned from procedure ignores setFetchSize() on
Date: 2004-06-08 15:56:05
Message-ID: Pine.BSO.4.56.0406081039580.28474@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

On Tue, 8 Jun 2004, Brian G. Huber wrote:

> I need to return large result sets and therefore need a cursor with a small
> fetch size (to avoid caching the entire query at once).  However, it appears
> that when a cursor is returned from a callable statement setFetchSize is
> ignored.
> 
> Is this a bug or am I doing something wrong?  Any comments greatly
> appreciated. Thanks
> 

Yes, currently refcursor based ResultSets fetch all rows at once.  I would
say that this is a missing feature rather than a bug, but in any case it's
something the driver can't do right now.  I'll put this on my todo list, 
but it's not going at the top.

I was under the impression that refcursor returning functions would fade 
with the advent of easier set returning functions.  Have you considered 
using them instead?  The advantage of returning refcursor seems to me that 
you don't need to create a pseudo type for the return value, or deal with 
specifying record types in the query.  Are there other advantages I'm 
missing?

Kris Jurka

In response to

Responses

pgsql-jdbc by date

Next:From: Nic FerrierDate: 2004-06-08 20:12:55
Subject: Re: Cursor returned from procedure ignores setFetchSize() on
Previous:From: Brian G. HuberDate: 2004-06-08 15:16:01
Subject: Cursor returned from procedure ignores setFetchSize() on CallableStatement

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