Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id A41AF476098 for ; Tue, 28 May 2002 12:50:50 -0400 (EDT) Received: from localhost (p508008EC.dip.t-dialin.net [80.128.8.236]) by postgresql.org (Postfix) with ESMTP id E175A476116 for ; Tue, 28 May 2002 12:47:12 -0400 (EDT) Received: from eckhard by localhost with local (Exim 3.35 #1 (Debian)) id 17Ck7y-00004q-00 for ; Tue, 28 May 2002 18:47:18 +0200 Date: Tue, 28 May 2002 18:47:17 +0200 From: Eckhard Hoeffner To: PHP PostgreSQL Subject: Re: using CURSOR with PHP Message-ID: <20020528164717.GA32715@fifoost.org> Mail-Followup-To: PHP PostgreSQL References: <20020528161603.GA32455@fifoost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.3.28i X-Archive-Number: 200205/102 X-Sequence-Number: 1234 * Marco Colombo [28 05 02 18:26]: >On Tue, 28 May 2002, Eckhard Hoeffner wrote: > >> * Marco Colombo [28 05 02 17:32]: > >> >AFAIK, a CURSOR may be used only inside a single transaction, not a >> >single session. So it can't be used to 'page' the output of a query, >> >for example. >> > >> >And, also AFAIK, even with pconnect, each connect creates a different >> >session. Only the (TCP) connection is re-used. I mean, nothing changes >> >from the PHP script standpoint when you switch from pg_connect() to >> >pg_pconnect(). >>=20 >> I think, you are right. The connection browser<->web server is cut >> after the web server has send all TCP/IP-packages, no matter how >> long it takes till they are received on the client side (browser). >> If there ist a request for a new database connection, the web server >> does not know whether this is the former user or a new user. For >> this reason the result I wanted to acchive is not possible.=20 > >Well, with HTTP keepalive, it may even keep the HTTP session open. >But the problem is that you can't relay on it. >Moreover, I suspect that PHP resets the SQL session when it performs >an pconnect (that means, it asks the SQL backend to abort uncommitted >transactions, drop TEMP relations, and so on). > >And, no matter what is the actual behaviour, the docs are clear: > > "An important summary. Persistent connections were designed to have > one-to-one mapping to regular connections. That means that you should > always be able to replace persistent connections with non-persistent > connections, and it won't change the way your script behaves. It may > (and probably will) change the efficiency of the script, but not its > behavior!" > >so even if it worked, it's an undocumented feature... well, it's a bug, I did not claim, that it worked and after having read the thread I also think, it will not work, however, I will try this at home. If it works, I will send the results.=20=20 --=20 --//--\\-- Eckhard Hoeffner e-hoeffner@fifoost.org Tal 44=20 D-80331 M=FCnchen