Re: Find out the number of rows returned by refcursor?

From: "Karen Hill" <karen_hill22(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Find out the number of rows returned by refcursor?
Date: 2006-10-11 18:42:09
Message-ID: 1160592129.764640.314170@i3g2000cwc.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Tom Lane wrote:
> "Karen Hill" <karen_hill22(at)yahoo(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message J S B 2006-10-11 18:50:59 invalid data in PID file
Previous Message Tom Lane 2006-10-11 18:31:08 Re: Find out the number of rows returned by refcursor?