Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 734499FA18C for ; Tue, 5 Dec 2006 11:55:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 63544-04 for ; Tue, 5 Dec 2006 11:55:10 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id E82CE9F938C for ; Tue, 5 Dec 2006 11:55:16 -0400 (AST) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1GrcdK-0001wT-CG for pgsql-sql@postgresql.org; Tue, 05 Dec 2006 16:55:02 +0100 Received: from 81.255.119.165 ([81.255.119.165]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Dec 2006 16:55:02 +0100 Received: from softexpert by 81.255.119.165 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Dec 2006 16:55:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Marian POPESCU Subject: transaction in function Date: Tue, 05 Dec 2006 16:25:31 +0100 Lines: 10 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 81.255.119.165 User-Agent: KNode/0.10.4 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.388 tagged_above=0 required=5 tests=BAYES_05, RCVD_NUMERIC_HELO, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200612/52 X-Sequence-Number: 27008 Hi, 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 ? Thank you for helping me out on this one !