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 53FE18BA030 for ; Mon, 14 Feb 2005 08:47:25 +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 52182-09 for ; Mon, 14 Feb 2005 08:47:19 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 04D258BA01F for ; Mon, 14 Feb 2005 08:47:18 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j1E8l4CZ026274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Feb 2005 01:47:06 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j1E8l4Hp004147; Mon, 14 Feb 2005 01:47:04 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j1E8l44B004146; Mon, 14 Feb 2005 01:47:04 -0700 (MST) (envelope-from mfuhr) Date: Mon, 14 Feb 2005 01:47:03 -0700 From: Michael Fuhr To: Hasnul Fadhly bin Hasan Cc: pgsql-performance@postgresql.org Subject: Re: Autocommit Message-ID: <20050214084703.GA4038@winnie.fuhr.org> References: <42105AD0.2010803@mimos.my> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42105AD0.2010803@mimos.my> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/206 X-Sequence-Number: 10535 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.... -- Michael Fuhr http://www.fuhr.org/~mfuhr/