Re: using CURSOR with PHP

Поиск
Список
Период
Сортировка
От Eckhard Hoeffner
Тема Re: using CURSOR with PHP
Дата
Msg-id 20020518110325.GA24074@fifoost.org
обсуждение исходный текст
Ответ на Re: using CURSOR with PHP  (Andrew McMillan <andrew@catalyst.net.nz>)
Ответы Re: using CURSOR with PHP  (Andrew McMillan <andrew@catalyst.net.nz>)
Re: using CURSOR with PHP  (Marco Colombo <marco@esi.it>)
Список pgsql-php
* Andrew McMillan <andrew@catalyst.net.nz> [18 05 02 12:36]:

>Eckhard Hoeffner wrote:
>>Does anyone has a solution to use the CURSOR function with PHP. The
>>main problem - in my opinion - is, that the CURSOR must be closed
>>and if the database is accessed from a web browser, this can not be
>>ensured.
>>
>
>I don't use cursors in web applications myself, since PostgreSQL
>supports the excellent "SELECT ... LIMIT <n> OFFSET <m>" syntax in all
>of the cases where I might otherwise have done so.

That's what I wanted to avoid as this results in a little more
work.

>That's my experience to date, anyway - I'm prepared to find somewhere a
>cursor might be a requirement - I know that if you wanted to write
>cross-database portable code you would probably need to work with them.
>
>Regardless, unless you open your database connection as a persistent
>connection, the database connection will be closed when the script
>finishes, and that should clean up all that is necessary.

I used persistent connections, however, I got lots of <defunct>
processes.
If the CURSOR is closed when the script has finished (pg_connect),
it makes no sense (for me) using it, because I can not move within
the results.



--
--//--\\--
Eckhard Hoeffner
e-hoeffner@fifoost.org
Tal 44
D-80331 München

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

Предыдущее
От: Andrew McMillan
Дата:
Сообщение: Re: using CURSOR with PHP
Следующее
От: Andrew McMillan
Дата:
Сообщение: Re: using CURSOR with PHP