"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > On Mon, Jan 23, 2006 at 06:35:18PM +0900, Daisuke Maki wrote: > > A quick scan of the docs and the source code tree seems to indicate that > > there is no such thing as a rollback trigger, short of hacking it. > > > > Now, I'm wondering: > > 1. Is there a rollback/commit trigger? If not, is it planned to be > > implemented at all? > > 2. Is there a way to undo changes to data external to postgres > > when a rollback occurs, OR, only update that external data > > when a commit occurs? > > Actually, this is something that often comes up in terms of > LISTEN/NOTIFY and doing external non-transactional stuff like sending > emails. AFAIK there's no plans to add support for anything like a > rollback trigger.
Well, note that in the case of LISTEN/NOTIFY the receiving side doesn't see the message until the sender commits. Precisely to maintain transactional integrity. If the external work can never fail then it seems like just postponing the processing of it until transaction commit time like deferred constraints would be better. I'm not sure you can really do that currently though. -- greg ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly