Can I do of in one call? - Mailing list pgsql-general

From Rory Campbell-Lange
Subject Can I do of in one call?
Date
Msg-id 20030616164354.GA4515@campbell-lange.net
Whole thread Raw
List pgsql-general
I am writing a function to interrogate the database and get a total row
count of rows matching the critera of a search, and then return a subset
of those rows. This is to satisfy the familiar  web <page> of <pages>
situation.

At the moment I call the query twice, one with limit and offset
statements, the other without these. I use ROW_COUNT after the second.

Is it possible to do a query, get the ROW_COUNT, and then use a cursor
or something similar to get the subset into a setof result%rowtype?

Thanks!
Rory

--
Rory Campbell-Lange
<rory@campbell-lange.net>
<www.campbell-lange.net>

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Sort memory not being released
Next
From: Arjen van der Meijden
Date:
Subject: Re: Postgres performance comments from a MySQL user