From: Filip Rembiałkowski <plk.zuber@gmail.com>
To: Gerardo Herzig <gherzig@fmed.uba.ar>
Cc: pgsql-sql@postgresql.org
Subject: Re: transaction and triggers
Date: Fri, 18 Jan 2008 15:42:21 +0100
Message-ID: <92869e660801180642i1fdd417r3d3b9399c5e5ab98@mail.gmail.com> (raw)
In-Reply-To: <4790B50A.5050101@fmed.uba.ar>
References: <4790B50A.5050101@fmed.uba.ar>
2008/1/18, Gerardo Herzig <gherzig@fmed.uba.ar>:
> 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.
If the transaction is rolled back, changes made by your trigger to
local database will be also canceled.
Unless you make any manipulation on remote databases, you have no problem.
Any changes made to remote databases, for example if you call some
dblink functions, are not transactional, and will not be rolled back.
In this case you have to rethink your design, as there is no "ON
COMMIT" trigger (yet?)
--
Filip Rembiałkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: plk.zuber@gmail.com, gherzig@fmed.uba.ar
Subject: Re: transaction and triggers
In-Reply-To: <92869e660801180642i1fdd417r3d3b9399c5e5ab98@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox