From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Matt Doucleff <matt(at)digitalfountain(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Need "InBetween" (not just Before and After) Trigger |
Date: | 2001-01-15 21:25:19 |
Message-ID: | Pine.BSF.4.21.0101151322400.17042-100000@megazone23.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, 15 Jan 2001, Tom Lane wrote:
> Matt Doucleff <matt(at)digitalfountain(dot)com> writes:
> > For example, say I want to create a file when a row is inserted, and
> > modify that file when the row is modified. If a transaction fails, I
> > need to undo my changes to the filesystem.
>
> Unless you want to implement your own undo log, I'd suggest rethinking
> this. What you really want is a trigger fired at commit time, ie a
> deferred trigger, so that you don't have to worry about rolling back
> your outside actions. I believe we have that facility for foreign key
> triggers, not sure if it's available for general use yet ...
Sort of, but it still isn't sufficient. There's no way to say for certain
that a later deferred trigger won't send an exception that will roll back
the transaction. What he'd really need would be something that occurs
after the deferred trigger queue and after the transaction has committed
that cannot cause the transaction to rollback (I'm not sure what an
error condition raised in such a state would do...)
From | Date | Subject | |
---|---|---|---|
Next Message | Alex Pilosov | 2001-01-15 21:25:45 | Re: SQL queries from within PL/PERL triggers? |
Previous Message | Tom Lane | 2001-01-15 21:06:12 | Re: problem running initdb |