Re: Using Cursors in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxxxxxxxxxx               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux