Re: Using Cursors in PHP

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Using Cursors in PHP
Дата
Msg-id 200308081734.h78HYhG02971@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Using Cursors in PHP  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-php
scott.marlowe wrote:
> On 8 Aug 2003, Markus Bertheau wrote:
>
> > ?? ??????, 06.08.2003, ?? 17:51, scott.marlowe ??????????:
> > > On Wed, 6 Aug 2003, Andreas Schmitz wrote:
> > >
> > > >
> > > > Hello *,
> > > >
> > > > I am just wondering if it is possible to use cursors within PHP. I need to
> > > > page query result from a big table and I am looking for a solution to avoid
> > > > scanning the complete table using limit and offset.
> > >
> > > Yes, you can use cursors, no you can't expect them to survive from one
> > > page to the next.
> >
> > What about the new feature in cursors "WITH HOLD"? Don't they survive?
>
> I don't think so.  Basically, PHP is supposed to reset the connection if
> it's persistant, and if it isn't persistant, then it's always a new
> connection, which means a cursor shouldn't survive.

Actually, that brings up a problem --- our RESET ALL doesn't close
cursors that are kept open using WITH HOLD.

However, you are right that you can't be sure you will get the same
backend when you connect via a new page, so WITH HOLD doesn't help here.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: Using Cursors in PHP
Следующее
От: Lynna Landstreet
Дата:
Сообщение: Paging results