Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: aspire420(at)hotpop(dot)com, Sai Hertz And Control Systems <sank89(at)sancharnet(dot)in>, pgsql-php(at)postgresql(dot)org
Subject: Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4
Date: 2003-12-11 23:50:24
Message-ID: 200312120050.24690.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-php

Robert Treat wrote:
> given you can override php.ini setting via php commands, ISTM
> application developers could still control this even if it was an ini
> setting.

Think about which entity determines what setting is required for
autocommit. It's not the database administrator, it's not the database
end user, it's not some tuning guy, it's not the binding library --
it's the particular client application. Because only the client
application knows how it will issue SQL commands and what autocommit
mode it expects for proper functioning. Therefore, there is never a
legitimate reason to control this setting anywhere else.

> how do other languages handle this? IIRC in perl/dbi it is a
> parameter of the connection string ie.
> pg_connect(host=foo,user=bar,autocommit=on) in php-ish speak, which
> doesn't seem like a bad way to do it.

In JDBC there is a method on the connection that controls this setting,
and the default setting is fixed in the spec (not determined by
external configuration). In ECPG, autocommit is off. Those are the
only interfaces I know that have sufficient standardization in this
area. The Perl way you cite seems reasonable as well.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Martin Marques 2003-12-12 00:36:43 Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4
Previous Message Robert Treat 2003-12-11 23:25:06 Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4

Browse pgsql-php by date

  From Date Subject
Next Message Martin Marques 2003-12-12 00:36:43 Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4
Previous Message Robert Treat 2003-12-11 23:25:06 Re: [ADMIN] PHP and autocommit of PostgreSQL 7.4