X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0DA42D6E86 for ; Wed, 24 Aug 2005 07:27:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62920-09 for ; Wed, 24 Aug 2005 10:27:12 +0000 (GMT) Received: from mail.webhotel.net (mail.webhotel.net [217.145.49.10]) by svr1.postgresql.org (Postfix) with SMTP id 5D685D701F for ; Wed, 24 Aug 2005 07:27:10 -0300 (ADT) Received: (qmail 39902 invoked from network); 24 Aug 2005 10:27:12 -0000 Received: from unknown (HELO ?192.168.42.125?) (62.66.186.164) by mail.webhotel.net with SMTP; 24 Aug 2005 10:27:12 -0000 Message-ID: <430C4B7F.4030907@netgroup.dk> Date: Wed, 24 Aug 2005 12:27:11 +0200 From: Bo Lorentsen User-Agent: Debian Thunderbird 1.0.2 (X11/20050817) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Borg Salling Cc: "pgsql-sql@postgresql.org" Subject: Re: Number of rows in a cursor ? References: <430C3C40.4070906@netgroup.dk> <430C43F5.2030506@navicon.dk> In-Reply-To: <430C43F5.2030506@navicon.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.018 required=5 tests=[AWL=0.018] X-Spam-Level: X-Archive-Number: 200508/213 X-Sequence-Number: 22441 Thomas Borg Salling wrote: > Bo Lorentsen wrote: > >> Is it possible to get the total number of rows found in a cursor, or >> must I make a count(*) and then a select ? > > > Perhaps: > GET DIAGNOSTICS rc = ROW_COUNT; Ok, and when I use the C interface the "DECLARE .." function will return the row count ? Can I use PQntuples( res ) after the "DECLARE CURSOR" statement (if so, it don't work for me :-)) ? /BL