Re: how to handle Pagination > - Mailing list pgsql-novice

From jesusthefrog
Subject Re: how to handle Pagination >
Date
Msg-id CAH_wARvFGFxoxdnXc5FP=qeZuAh+Azi_yGs1VG0NabGXc+Picw@mail.gmail.com
Whole thread Raw
In response to how to handle Pagination >  (Madhavan <vbtamil@zoho.com>)
Responses Re: how to handle Pagination >  (Vik Fearing <vik.fearing@dalibo.com>)
Re: how to handle Pagination >  (Kevin Hunter Kesling <kmhunte2@ncsu.edu>)
List pgsql-novice
You will probably want to use OFFSET and LIMIT, which are the window size and page. Something like

SELECT .. FROM ... WHERE ... ORDER BY (...) OFFSET y LIMIT x

So say you want to get 100 records at a time. You would get page 1 with OFFSET 0 LIMIT 100, then page 2 with OFFSET 100, OFFSET 200, and so on.

That's just off the top of my head. There may be another solution which will work better in your case, but lacking details, this is what I would recommend.

--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d+ s: a-- C++++(++) UL+++ P++++$ L+++>++++ E- W+ N o? K w--- O-
M- V? PS+++ PE(-) Y+ PGP->+++ t+>++ 5+++++ X(+) R>+ tv b+
DI++ D++>+++ G+ e* h! !r y**
------END GEEK CODE BLOCK------

pgsql-novice by date:

Previous
From: Madhavan
Date:
Subject: how to handle Pagination >
Next
From: Vik Fearing
Date:
Subject: Re: how to handle Pagination >