Jeevan Chalke <jeevan.cha...@enterprisedb.com> writes:
> 1. I have two functions func1 and func2.
> 2. func1 calls func2
> 3. Both has cursor with same name, say mycursor
> 4. Somehow I forgot closing it
> 5. executing func1 throws an error 'cursor "mycursor" already in use'

> Is this expected behavior???

Yes ... or at least, it's always been like that.

> I just mingled around the code and later appended a cursor count to the
> cursor name to allow same cursor name in nested levels.

That would break code that expects the cursor name to be what it said
it should be.  It is documented that you can refer to cursors by name
across multiple functions.

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to