Re: Pagination - 1 or 2 queries?

From: CSN <cool_screen_name90001(at)yahoo(dot)com>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Pagination - 1 or 2 queries?
Date: 2003-09-05 18:56:57
Message-ID: 20030905185657.69480.qmail@web40608.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


--- "scott.marlowe" <scott(dot)marlowe(at)ihs(dot)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)?

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-09-05 19:28:06 Re: Panic Index!!!!
Previous Message CSN 2003-09-05 18:45:56 Re: Pagination - 1 or 2 queries?