Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 030DA65013C for ; Sat, 19 Jul 2008 10:27:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 71455-10 for ; Sat, 19 Jul 2008 10:27:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from easy2.in-chemnitz.de (easy2.in-chemnitz.de [88.198.17.232]) by postgresql.org (Postfix) with ESMTP id 8D494650129 for ; Sat, 19 Jul 2008 10:27:06 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by easy2.in-chemnitz.de (Postfix) with ESMTP id 444D0470006 for ; Sat, 19 Jul 2008 15:27:04 +0200 (CEST) Received: from easy2.in-chemnitz.de ([127.0.0.1]) by localhost (easy.in-chemnitz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oAxLfz9iSS6l for ; Sat, 19 Jul 2008 15:27:04 +0200 (CEST) Received: by easy2.in-chemnitz.de (Postfix, from userid 1013) id 34046470005; Sat, 19 Jul 2008 15:27:04 +0200 (CEST) Date: Sat, 19 Jul 2008 15:27:04 +0200 From: Tino Schwarze To: pgsql-admin@postgresql.org Subject: Re: Query Message-ID: <20080719132704.GF22515@easy2.in-chemnitz.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/171 X-Sequence-Number: 29781 On Sat, Jul 19, 2008 at 04:29:00PM +0530, Kartik wrote: > hello there,i am new to postgresql > i am using postgresql 8.3.3 and i am writing one whole transaction. i want > to know how to set auto commit off > because if any error occours i want the whole transaction to be rolled back. > when i tried alter database dbname set autocommit = off > then it gives me error saying autocommit not available > so can anyone suggest how to set autocommit as off so that i can rollback > the transaction.. Simply issue the command "BEGIN" at the start of your transaction. Then nothing will be commited until you issue "COMMIT" and you may abort the transaction by sending "ROLLBACK" (or "ABORT"). HTH, Tino. -- "What we nourish flourishes." - "Was wir nähren erblüht." www.craniosacralzentrum.de www.forteego.de