pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: scott.marlowe <scott.marlowe@ihs.com>
Cc: Markus Bertheau <twanger@bluetwanger.de>
Cc: Andreas Schmitz <a.schmitz@cityweb.de>
Cc: pgsql-php@postgresql.org
Subject: Re: Using Cursors in PHP
Date: Fri, 8 Aug 2003 13:34:43 -0400 (EDT)
Message-ID: <200308081734.h78HYhG02971@candle.pha.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.33.0308080721170.20444-100000@css120.ihs.com>

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



view thread (7+ messages)

Message-ID: <200308081734.h78HYhG02971@candle.pha.pa.us>
Permalink:  ../200308081734.h78HYhG02971@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200308081734.h78HYhG02971@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: pgman@candle.pha.pa.us, scott.marlowe@ihs.com, twanger@bluetwanger.de, a.schmitz@cityweb.de
  Subject: Re: Using Cursors in PHP
  In-Reply-To: <200308081734.h78HYhG02971@candle.pha.pa.us>
  References: <Pine.LNX.4.33.0308080721170.20444-100000@css120.ihs.com> <200308081734.h78HYhG02971@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox