X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1E1F38BA0C5 for ; Mon, 14 Feb 2005 08:59:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54517-03 for ; Mon, 14 Feb 2005 08:58:43 +0000 (GMT) Received: from ew.mimos.my (ew.mimos.my [192.228.129.34]) by svr1.postgresql.org (Postfix) with ESMTP id 1F0D88BA030 for ; Mon, 14 Feb 2005 08:58:42 +0000 (GMT) Received: from mimos.my (mcg189.nat.mimos.my [10.1.18.189]) by ew.mimos.my (8.12.9p2/8.12.9) with ESMTP id j1E8wadp087413; Mon, 14 Feb 2005 16:58:36 +0800 (MYT) (envelope-from hasnulfadhly.h@mimos.my) Message-ID: <42106837.3020103@mimos.my> Date: Mon, 14 Feb 2005 16:58:31 +0800 From: Hasnul Fadhly bin Hasan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Fuhr Cc: pgsql-performance@postgresql.org Subject: Re: Autocommit References: <42105AD0.2010803@mimos.my> <20050214084703.GA4038@winnie.fuhr.org> In-Reply-To: <20050214084703.GA4038@winnie.fuhr.org> Content-Type: multipart/alternative; boundary="------------060209090609060406000901" X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.333 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, HTML_20_30, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: X-Archive-Number: 200502/207 X-Sequence-Number: 10536 This is a multi-part message in MIME format. --------------060209090609060406000901 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Micheal, Thanks for the reply. I am using postgres 7.4.5 client. There's one that is using 7.4.1 client. I'm not sure if there would be any difference. When i use psql and check the status of autocommit, it is set to enable. I'm not sure if libpq and psql uses the same defaults. Thanks, Hasnul Michael Fuhr wrote: >On Mon, Feb 14, 2005 at 04:01:20PM +0800, Hasnul Fadhly bin Hasan wrote: > > >>I am just wondering, by default, autocommit is enabled for every client >>connection. The documentations states that we have to use BEGIN >>and END or COMMIT so to increase performance by not using autocommit. >>My question is, when we use the BEGIN and END statements, is autocommit >>unset/disabled automatically or we have to disable/unset it manually? >> >> > >What version of PostgreSQL is your server running and what client >software are you using? PostgreSQL 7.3 had a server-side autocommit >setting, but it caused problems with some clients so 7.4 got rid >of it and left autocommit up to the client. How to enable or disable >client-side autocommit depends on the client software, but if you're >able to execute a BEGIN (or START TRANSACTION) statement then you >should be inside a transaction until you execute COMMIT (or END) >or ROLLBACK. That is, unless your client intercepts these statements >and does whatever it wants.... > > > --------------060209090609060406000901 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Micheal,

Thanks for the reply.  I am using postgres 7.4.5 client.  There's one that is using 7.4.1 client.  I'm not sure if there would be any difference.
When i use psql and check the status of autocommit, it is set to enable.  I'm not sure if libpq and psql uses the same defaults.

Thanks,

Hasnul



Michael Fuhr wrote:
On Mon, Feb 14, 2005 at 04:01:20PM +0800, Hasnul Fadhly bin Hasan wrote:
  
I am just wondering, by default, autocommit is enabled for every client 
connection.  The documentations states that we have to use BEGIN
and  END or COMMIT so to increase performance by not using autocommit. 
My question is, when we use the BEGIN and END statements, is autocommit 
unset/disabled automatically or we have to disable/unset it manually?
    

What version of PostgreSQL is your server running and what client
software are you using?  PostgreSQL 7.3 had a server-side autocommit
setting, but it caused problems with some clients so 7.4 got rid
of it and left autocommit up to the client.  How to enable or disable
client-side autocommit depends on the client software, but if you're
able to execute a BEGIN (or START TRANSACTION) statement then you
should be inside a transaction until you execute COMMIT (or END)
or ROLLBACK.  That is, unless your client intercepts these statements
and does whatever it wants....

  
--------------060209090609060406000901--