cursor already in use error - Mailing list pgsql-general

From Sim Zacks
Subject cursor already in use error
Date
Msg-id d03pll$1nme$1@news.hub.org
Whole thread Raw
Responses Re: cursor already in use error
List pgsql-general
PostGreSQL 8.0beta1
I have a function that uses a cursor and it is giving me the error: cursor
"crsr" already in use when the parameters I pass in come from another table.

The function works fine when I call it by itself, such as select
PartNeedsReschedule(100,1) or select * from PartNeedsReschedule(100,1)
but when I try select PartNeedsReschedule(PartID,1) from Parts then I get
the error.

It seems that when I qualify the query such as PartNeedsReschedule(PartID,1)
from Parts where partid=100
then it works because it is only returning one row.

Is this a known problem with cursor based functions that they can not be
called by set based queries?
Is there a workaround?

Thank You
Sim



pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: Performance of Views
Next
From: Michael Fuhr
Date:
Subject: Re: cursor already in use error