length of recordset read through a cursor

From: "Knut P(dot) Lehre" <k(dot)p(dot)lehre(at)tiscali(dot)no>
To: pgsql-sql(at)postgresql(dot)org
Subject: length of recordset read through a cursor
Date: 2003-07-29 14:10:22
Message-ID: 5.2.0.9.2.20030729160030.019b5ad0@uio-pop.uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-07-29 15:00:56 Re: Problem using Subselect results
Previous Message Mark Roberts 2003-07-29 14:04:04 unsubscribe