Re: cursor already in use error

Поиск
Список
Период
Сортировка
От Sim Zacks
Тема Re: cursor already in use error
Дата
Msg-id d04330$31he$1@news.hub.org
обсуждение исходный текст
Ответ на cursor already in use error  ("Sim Zacks" <sim@compulab.co.il>)
Список pgsql-general
> 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)
>

You got it.
I was closing the cursor at the end of the function, but there were other
possible returns in the middle.
I changed the code to add close before each return and it works like a
charm.

I rushed together the example, or I should have caught that.

Much thanks.
Sim




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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: cursor already in use error
Следующее
От: "Sim Zacks"
Дата:
Сообщение: Re: cursor already in use error