pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Don Croata <el.croata@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Cursors and recursion
Date: Wed, 28 Dec 2005 11:29:19 -0300
Message-ID: <be9533860512280629m1c1163bm73fef37f17541423@mail.gmail.com> (raw)

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

view thread (5+ messages)  latest in thread

Message-ID: <be9533860512280629m1c1163bm73fef37f17541423@mail.gmail.com>
Permalink:  ../be9533860512280629m1c1163bm73fef37f17541423@mail.gmail.com/
Also on:    postgresql.org/message-id/be9533860512280629m1c1163bm73fef37f17541423@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: el.croata@gmail.com
  Subject: Re: Cursors and recursion
  In-Reply-To: <be9533860512280629m1c1163bm73fef37f17541423@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox