Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B75592E0070 for ; Fri, 18 Jan 2008 10:16:11 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 04327-05 for ; Fri, 18 Jan 2008 10:16:07 -0400 (AST) Received: from mail.fmed.uba.ar (mail.fmed.uba.ar [157.92.152.1]) by postgresql.org (Postfix) with ESMTP id 80FA52E319C for ; Fri, 18 Jan 2008 10:16:07 -0400 (AST) Received: from [157.92.155.58] (mailbis [157.92.155.58]) by mail.fmed.uba.ar (Postfix) with ESMTP id ED80E11C742 for ; Fri, 18 Jan 2008 12:16:15 -0200 (ARST) Message-ID: <4790B50A.5050101@fmed.uba.ar> Date: Fri, 18 Jan 2008 11:17:46 -0300 From: Gerardo Herzig User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: transaction and triggers Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/148 X-Sequence-Number: 30001 Hi all. Im puzzled again. Just thinking: As im having fun trying to make my own replication system, im stuck in this situation: Consider a simple table with a unique index on the `id' field, and a function who will fail, such as insert into test (id) values (1); insert into test (id) values (1); This will fail and the transaction will be rollback'ed, but as the basis of my replication system is on row level triggers, the first time the insert is called, the trigger will be executed, and i will like to be able to stack the triggers in some way, in order to be fired only after a succesfull execution of the hole function. Im also reading the NOTIFY/LISTEN mechanism and the rule system as a workarround on this, but the fact is that there is a lot of client code, and will take a big amount of time to change it. Any sugestions? Thanks! Gerardo