[imp] PostgreSQL and pconnect() ... an evil combination ...
Martin A. Marques
martin@math.unl.edu.ar
Thu, 2 Nov 2000 15:49:56 -0300
On Jue 02 Nov 2000 14:46, you wrote:
Yes I had noticed that lots of postmaster where opened. I had no idea that
the PHP pg_pconnect was broken. Does anybody know who is in charge of the
postgres module of PHP?
> In phplib/db_pgsql.inc, the connect is called as:
>
> function connect() {
> if ( 0 == $this->Link_ID ) {
> $cstr = "dbname=".$this->Database.
> $this->ifadd($this->Host, "host=").
> $this->ifadd($this->Port, "port=").
> $this->ifadd($this->User, "user=").
> $this->ifadd($this->Password, "password=");
> $this->Link_ID=pg_pconnect($cstr);
> if (!$this->Link_ID) {
> $this->halt("Link-ID == false, pconnect failed");
> }
> }
> }
>
> It is well known that PHP and persistent connections to PostgreSQL are
> broken, such that you end up with quite a few idle processes in your
> backend that will never get re-used:
Saludos... :-)
--
"And I'm happy, because you make me feel good, about me." - Melvin Udall
-----------------------------------------------------------------
Martín Marqués email: martin@math.unl.edu.ar
Santa Fe - Argentina http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------