Re: cursor already in use error

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: cursor already in use error
Date: 2005-03-02 09:53:37
Message-ID: 20050302095337.GA48338@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Mar 02, 2005 at 11:15:52AM +0200, Sim Zacks wrote:

> select name,testcursor(testid) from test; --doesn't work
> select name,testcursor(testid) from test where testid=1; -- works (as does
> testid=2 or 3)

If I add "close crs;" before the function returns, I get this:

SELECT name, testcursor(testid) FROM test;
name | testcursor
------+--------------------------------
Bob | -Comment 1-Comment 2-Comment 3
Mark | -Comment 1
Tom |
(3 rows)

Is that what you're after? If so, then the problem might simply
be that you're not closing the cursor when you're done with it.
Will closing it work in the real code?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2005-03-02 09:55:59 Re: cursor already in use error
Previous Message Csaba Nagy 2005-03-02 09:33:25 Re: Replication from other SQL Server