X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BF9BC9DC993 for ; Wed, 28 Dec 2005 10:29:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63392-08 for ; Wed, 28 Dec 2005 10:29:21 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.199]) by postgresql.org (Postfix) with ESMTP id B5A819DC80F for ; Wed, 28 Dec 2005 10:29:14 -0400 (AST) Received: by zproxy.gmail.com with SMTP id 14so1538114nzn for ; Wed, 28 Dec 2005 06:29:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=F9qzLV9d7FLp1kfelhaLEOvsxNXQOnG5wAH9XAT+Oi0l2Ni213j6YmbB/Odc4llpnwks1wa6JU1Bd9RGlm6vV5qEPxkcbMQ9g49ZbCWiZg2TskW8simvTkMlcVxX3SAftsaik9kL20MSvW2PHraELwrKHFw620PQ2/5DVG+KiaM= Received: by 10.36.39.6 with SMTP id m6mr4345146nzm; Wed, 28 Dec 2005 06:29:19 -0800 (PST) Received: by 10.37.13.6 with HTTP; Wed, 28 Dec 2005 06:29:19 -0800 (PST) Message-ID: Date: Wed, 28 Dec 2005 11:29:19 -0300 From: Don Croata To: pgsql-sql@postgresql.org Subject: Cursors and recursion MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_717_12001140.1135780159070" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.001 required=5 tests=[HTML_MESSAGE=0.001] X-Spam-Score: 0.001 X-Spam-Level: X-Archive-Number: 200512/217 X-Sequence-Number: 23759 ------=_Part_717_12001140.1135780159070 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, I've been trying to do recursion and cursors in PL/PgSQL (PostgreSQL 8.1). It's a function who has a cursor and calls itself, but the problem raises after the first recursion, when PgSQL complains: ERROR: cursor "cur" already in use Are the cursors kept globally? or cached like TEMP TABLE? There's an example code available in http://www.croata.cl/cur.sql . In fact= , it is an abstraction of the real stored procedure where the problem occurs. -- Thanks in advance, Cro ------=_Part_717_12001140.1135780159070 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi,
 
I've been trying to do recursion and cursors in PL/PgSQL (PostgreSQL 8= .1). It's a function who has a cursor and calls itself, but the problem rai= ses after the first recursion, when PgSQL complains:
 
ERROR:  cursor "cur" already in use
 
Are the cursors kept globally? or cached like TEMP TABLE?
 
There's an example code available in http://www.croata.cl/cur.sql . In fact, it is an abstracti= on of the real stored procedure where the problem occurs.
 
--
 
Thanks in advance,
Cro
 
------=_Part_717_12001140.1135780159070--