Re: PHP and PostgreSQL

From: Daniele Orlandi <daniele(at)orlandi(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>, PostgreSQL-interfaces <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: PHP and PostgreSQL
Date: 2000-12-27 14:39:14
Message-ID: 3A49FF12.91CA2183@orlandi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Bruce Momjian wrote:
>
> I have been asked by the major PHP developer Rasmus Lerdorf to see if
> the PostgreSQL/PHP interface needs any improvements.
>
> Is the current PostgreSQL interface module in PHP adequate? Does it
> support all the current libpq features?
>
> If not, would someone submit some patches to the PHP folks. They want
> us to work well with PHP. They are basically encouraging us to improve
> it in any way we can.

If I can put my 0.02 Euros, I think there are two issues that deserve to
be fixed, both are relative to persistent connections.

The first is that the transaction state is (obviously) kept between
connections. This is not a problem in itself, but there are some
situations where the transaction block is not closed with COMMIT or
ABORT with the obvious consequencies when the connection is reused (and
with the locks not released). As a workaround I registered a shutdown
funcion that sends an ABORT command every time a script finishes his
processing but this results in a "Not in trasaction block" error most of
the time (harmless but pretty annoying).
IMHO there should be some sort of lightweight reset that puts the
connection in its pristine state without the need to fork a backend
againg and reopen the TCP connection.

The second is that if PostgreSQL is restarted, PHP doesn't detect that
and an error message is seen for every persistent connection. IMHO PHP
should detect a closed connection and clear the connections pool.

Bye!

--
Daniele

-------------------------------------------------------------------------------
Daniele Orlandi - Utility Line Italia - http://www.orlandi.com
Via Mezzera 29/A - 20030 - Seveso (MI) - Italy
-------------------------------------------------------------------------------

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-12-27 15:08:29 Re: [HACKERS] Re: Tuple-valued datums on Alpha (was Re: 7.1 on DEC/Alpha)
Previous Message Adam Lang 2000-12-27 14:14:40 Re: RE: [HACKERS] PHP and PostgreSQL

Browse pgsql-interfaces by date

  From Date Subject
Next Message Rod Taylor 2000-12-27 15:09:59 Re: PHP and PostgreSQL
Previous Message Adam Lang 2000-12-27 14:14:40 Re: RE: [HACKERS] PHP and PostgreSQL