Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 91BF99FA37A for ; Tue, 5 Dec 2006 12:57:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 99217-05 for ; Tue, 5 Dec 2006 12:57:18 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id A7E119F9F7B for ; Tue, 5 Dec 2006 12:57:17 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id kB5GvCgQ005993; Tue, 5 Dec 2006 11:57:15 -0500 (EST) To: Marian POPESCU cc: pgsql-sql@postgresql.org Subject: Re: transaction in function In-reply-to: References: Comments: In-reply-to Marian POPESCU message dated "Tue, 05 Dec 2006 16:25:31 +0100" Date: Tue, 05 Dec 2006 11:57:12 -0500 Message-ID: <5992.1165337832@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/54 X-Sequence-Number: 27010 Marian POPESCU writes: > I want to write a function that updates several tables; if there is an > exception while updating, it should rollback the transaction and raise an > error. > How can this be done in pgPLSQL in PostgreSQL 8.1 ? You just do it. You would have to work at it to *not* have that behavior. regards, tom lane