Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 62814650202 for ; Mon, 1 Sep 2008 12:53:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 76654-07 for ; Mon, 1 Sep 2008 12:52:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id C7CDA64FCDF for ; Mon, 1 Sep 2008 12:52:57 -0300 (ADT) Received: from perhan.alvh.no-ip.org (200-126-66-230.bk5-dsl.surnet.cl [200.126.66.230]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m81Ftr2C024010 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Sep 2008 08:55:56 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id F216E47CA7; Mon, 1 Sep 2008 11:52:40 -0400 (CLT) Date: Mon, 1 Sep 2008 11:52:40 -0400 From: Alvaro Herrera To: mike stanton Cc: pgsql-general@postgresql.org Subject: Re: refcursor Message-ID: <20080901155240.GF3776@alvh.no-ip.org> References: <001201c90c3f$697618b0$0d6ea8c0@mike> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <001201c90c3f$697618b0$0d6ea8c0@mike> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Mon, 01 Sep 2008 08:55:56 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/24 X-Sequence-Number: 137031 mike stanton escribió: > > Hello all, > I've got a problem I can't get round. I want to declare a refcursor variable in a C program and call a function which returns a refcursor portal to the main C program. > When I compile the C program, I get a refcursor doesn´t exist message. > Has anyone got a C program which uses a refcursor variable? Make sure the C program opens a transaction before calling the function, otherwise the cursor is automatically closed as soon as the function ends. -- Alvaro Herrera Valdivia, Chile Geotag: -39,815 -73,257 "Ah, spring... when a young penguin's fancy lightly turns to thoughts of ... Beta testing!" (Fedora 9 beta announcement)