Re: Cursors and recursion

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Cursors and recursion
Дата
Msg-id 17343.1135784905@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Cursors and recursion  (Don Croata <el.croata@gmail.com>)
Ответы Re: Cursors and recursion  (Michael Fuhr <mike@fuhr.org>)
Re: Cursors and recursion  (Don Croata <el.croata@gmail.com>)
Список pgsql-sql
Don Croata <el.croata@gmail.com> writes:
> 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?

Cursor names are global within a particular session.

IIRC there is a syntax for opening a cursor without specifying a name,
in which case plpgsql will pick one that's not in use.  This is probably
what you want to use.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: "large" IN/NOT IN subqueries result in query returning wrong data
Следующее
От: Jaime Casanova
Дата:
Сообщение: Re: instead of trigger in pg