From: Knut P. Lehre <k.p.lehre@tiscali.no>
To: pgsql-sql@postgresql.org
Subject: length of recordset read through a cursor
Date: Tue, 29 Jul 2003 16:10:22 +0200
Message-ID: <5.2.0.9.2.20030729160030.019b5ad0@uio-pop.uio.no> (raw)
After declaring a cursor, one way of obtaining the length of the resultset
is to perform a "MOVE 0" and read the PQcmdStatus which returns a "MOVE nn"
where nn is the length of the resultset. (A negative MOVE can then be used
to allow starting to fetch records from the beginning of the resultset.)
Is there another, possibly faster way?
Thanks, K.P.Lehre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: k.p.lehre@tiscali.no
Subject: Re: length of recordset read through a cursor
In-Reply-To: <5.2.0.9.2.20030729160030.019b5ad0@uio-pop.uio.no>
References: <5.2.0.9.2.20030729160030.019b5ad0@uio-pop.uio.no>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox