pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Eckhard Hoeffner <e-hoeffner@fifoost.org>
To: PHP PostgreSQL <pgsql-php@postgresql.org>
Subject: Re: using CURSOR with PHP
Date: Tue, 28 May 2002 18:47:17 +0200
Message-ID: <20020528164717.GA32715@fifoost.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0205281818130.24472-100000@Megathlon.ESI>
References: <20020528161603.GA32455@fifoost.org>
	<Pine.LNX.4.44.0205281818130.24472-100000@Megathlon.ESI>

* Marco Colombo <marco@esi.it> [28 05 02 18:26]:

>On Tue, 28 May 2002, Eckhard Hoeffner wrote:
>
>> * Marco Colombo <marco@esi.it> [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().
>> 
>> 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. 
>
>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.  


-- 
--//--\\--
Eckhard Hoeffner
e-hoeffner@fifoost.org
Tal 44 
D-80331 München



view thread (23+ messages)  latest in thread

Message-ID: <20020528164717.GA32715@fifoost.org>
Permalink:  ../20020528164717.GA32715@fifoost.org/
Also on:    postgresql.org/message-id/20020528164717.GA32715@fifoost.org

 · 

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: e-hoeffner@fifoost.org
  Subject: Re: using CURSOR with PHP
  In-Reply-To: <20020528164717.GA32715@fifoost.org>
  References: <20020528161603.GA32455@fifoost.org> <Pine.LNX.4.44.0205281818130.24472-100000@Megathlon.ESI> <20020528164717.GA32715@fifoost.org>

* 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