Looks like it works. I just tried a related item:
> Now the other way round:
>
> (S1) insert into t1 values (1);
> (S1) begin;
> (S2) delete from t1 where a = 1;
> (S1) insert into t2 values (1);
I swapped the above two items, and the INSERT properly failed the
contraint.
>
> (S2) -- Session is now blocked
>
> (S1) commit;
>
> (S2) -- Session continues without error
I was a little unsure how trigger visibility was going to handle cases
where the constraint failure happened after the other transaction
started, but it seems to work fine.
It is only the trigger that has full visibility, not the statements in
the query, right?
-- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026