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

From: James Ireland <james(at)halfcab(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Fetching rows from a cursor returned by a stored function
Date: 2004-09-18 20:09:27
Message-ID: 414C95F7.7060108@halfcab.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Thanks a lot for your help. I've implemented the successive "FETCH n" commands approach and it works a treat.

-James

Tom Lane wrote:
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-09-18 20:30:51 Re: "Idle in Transaction" revisited.
Previous Message Richard Welty 2004-09-18 17:08:06 Re: Issues regarding code license of ported code.