X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 05D91D1C93D for ; Tue, 29 Jul 2003 14:12:24 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 68454-09 for ; Tue, 29 Jul 2003 11:11:29 -0300 (ADT) Received: from smtp220.tiscali.dk (smtp220.tiscali.dk [62.79.79.114]) by svr1.postgresql.org (Postfix) with ESMTP id 9195AD1C921 for ; Tue, 29 Jul 2003 11:12:21 -0300 (ADT) Received: from cpmail2.dk.tiscali.com (mail.tiscali.dk [212.54.64.159]) by smtp220.tiscali.dk (8.12.6p2/8.12.6) with ESMTP id h6TECNBS009415 for ; Tue, 29 Jul 2003 16:12:25 +0200 (CEST) (envelope-from k.p.lehre@tiscali.no) Received: from pk-bpc-maritah.tiscali.no (213.142.74.64) by cpmail2.dk.tiscali.com (6.7.018) id 3F16EA70000EFE23 for pgsql-sql@postgresql.org; Tue, 29 Jul 2003 16:12:24 +0200 Message-Id: <5.2.0.9.2.20030729160030.019b5ad0@uio-pop.uio.no> X-Sender: knutle@uio-pop.uio.no X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Tue, 29 Jul 2003 16:10:22 +0200 To: pgsql-sql@postgresql.org From: "Knut P. Lehre" Subject: length of recordset read through a cursor Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/492 X-Sequence-Number: 14606 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