pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Eric Chamberlain <eric.chamberlain@hotmail.com>
To: pgsql-php@postgresql.org <pgsql-php@postgresql.org>
Subject: Unbuffered queries
Date: Wed, 8 Jan 2014 13:53:46 -0600
Message-ID: <BLU168-W6E6F9F54342A13F29A86484B10@phx.gbl> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-php>

When using php_query(), is this buffering all of the results from the query into memory? If so, is there a parameter I can send to make it not buffer the query? I've also seen comments suggesting that a cursor should be used. There doesn't seem to be any way to get access to the internal cursor used by the PHP pgsql libs... or are they referring to doing something like this:
$result = pg_query($conn, "BEGIN; DECLARE s CURSOR FOR SELECT * FROM users; FETCH ALL IN s; END;");

And then after which I could do this:
while ($row = pg_fetch_assoc($result)) {    ...}
I don't have a large enough result set in my development or QA environment to run this query within PHP to know if it works or not. Any suggestions would be helpful. Thank you!
Eric Chamberlain 		 	   		  =

view thread (5+ messages)  latest in thread

Message-ID: <BLU168-W6E6F9F54342A13F29A86484B10@phx.gbl>
Permalink:  ../BLU168-W6E6F9F54342A13F29A86484B10@phx.gbl/
Also on:    postgresql.org/message-id/BLU168-W6E6F9F54342A13F29A86484B10@phx.gbl

 · 

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: eric.chamberlain@hotmail.com
  Subject: Re: Unbuffered queries
  In-Reply-To: <BLU168-W6E6F9F54342A13F29A86484B10@phx.gbl>
  References: <BLU168-W6E6F9F54342A13F29A86484B10@phx.gbl>

* 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