Re: Find out the number of rows returned by refcursor? - Mailing list pgsql-general

From Karen Hill
Subject Re: Find out the number of rows returned by refcursor?
Date
Msg-id 1160592129.764640.314170@i3g2000cwc.googlegroups.com
Whole thread Raw
In response to Re: Find out the number of rows returned by refcursor?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> "Karen Hill" <karen_hill22@yahoo.com> writes:
> > -- Is there a way to know the total number of rows the cursor is
> > capable of traversing without using --count?
>
> If you want an accurate count, the only way is to traverse the cursor.
> Consider using MOVE FORWARD ALL and noting the rowcount, then MOVE
> BACKWARD ALL to reset the cursor (the latter at least should be
> reasonably cheap).
>

Cool.  Quick question, how does one go about noting the rowcount?
Using the rowcount in get diagnostics or something else?

regards,
karen.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Find out the number of rows returned by refcursor?
Next
From: "J S B"
Date:
Subject: invalid data in PID file