Counting rows in a PL/PgSQL CURSOR without fetching?

From: Reg Me Please <regmeplease(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Counting rows in a PL/PgSQL CURSOR without fetching?
Date: 2008-09-25 16:31:05
Message-ID: 200809251831.06305.regmeplease@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.
Is there a way in PL/PgSQL to get the number of rows resulting from a:
OPEN curs1 SCROLL FOR EXECUTE query;
before actually fetching any?

Unuckily
MOVE LAST FROM curs1;
won't work with
GET DIAGNOSTICS cnt = ROW_COUNT;

Any hint?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-09-25 16:35:00 Re: regexp_replace() [noindex] thing
Previous Message A B 2008-09-25 16:25:33 on duplicate key