On Fri, 5 Sep 2003, CSN wrote:
>
> --- "scott.marlowe" <scott.marlowe@ihs.com> wrote:
> > begin;
> > declare bubba as cursor for select * from table
> > order by fieldname;
> > move forward 100 in bubba;
> > fetch 5 from bubba;
> > rollback;
> >
> > Then you get the same kind of effect, but only 5
> > rows have to be retrieved
> > from the database to the client, and pg_fetch_array
> > will now iterate over
> > those 5 rows only, and then run dry, so to speak.
>
> Actually, with this method would you be able to get
> the count of all rows that could be returned (not just
> the 5)?
Yes, you can use "fetch absolute count from cursorname" should work.