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

Re: Fetching rows from a cursor returned by a stored function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: James Ireland <james(at)halfcab(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Fetching rows from a cursor returned by a stored function
Date: 2004-09-17 23:02:57
Message-ID: 25955.1095462177@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-jdbc
Oliver Jowett <oliver(at)opencloud(dot)com> writes:
> It might even work to execute FETCH FORWARD ALL for the cursor with a 
> non-zero fetchsize (and let the driver manage incremental fetches) but 
> I'm not sure what the behaviour of a non-zero row limit on a FETCH query 
> is at the protocol level..

[ digs in code... ]  It looks like the behavior would be to (a)
materialize the entire result of FETCH FORWARD ALL inside the backend,
then (b) hand back the number of rows you requested.  Probably not what
you want :-(.  I'd suggest issuing successive "FETCH n" commands and
ignoring the protocol-level limit feature.

			regards, tom lane

In response to

Responses

pgsql-jdbc by date

Next:From: John R PierceDate: 2004-09-17 23:30:47
Subject: "Idle in Transaction" revisited.
Previous:From: Oliver JowettDate: 2004-09-17 22:55:01
Subject: Re: Fetching rows from a cursor returned by a stored function

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