Re: before/after triggers - Mailing list pgsql-general

From Richard Huxton
Subject Re: before/after triggers
Date
Msg-id 200303271243.35959.dev@archonet.com
Whole thread Raw
In response to before/after triggers  (Dennis Gearon <gearond@cvc.net>)
List pgsql-general
On Wednesday 26 Mar 2003 10:30 pm, Dennis Gearon wrote:
> If I have a before trigger on table 'A' modify  table 'B' and an after
> trigger on table 'A' fails for that transaction:

All triggers take place within a single transaction.

> 1/ Is the change to table 'B' visible to anybody except that tranaction at
> any time?

Shouldn't be. It will never be committed.

> 2/ Does the change to table 'B' disappear/never show up when the after
> trigger fails?

Yes.

> 3/ Would all after triggers in that transaction see the change to table 'B'
> before the one particular after trigger fails?

Should do - they're in the same transaction. See chapter 9.2 of the user guide
"Transaction Isolation" for details

> 4/ do all the major DB's have this functionality? I.E.
>
>     Oracle
>     Sybase
>     MSSQL (yuck)
>     DB2
>     <other examples welcome>

Sorry, can't comment. All should offer similar functionality, but whether the
behaviour is identical I wouldn't want to say without testing.
--
  Richard Huxton


pgsql-general by date:

Previous
From: "Moritz Lennert"
Date:
Subject: Re: vacuum full fills up disk - solved
Next
From: Richard Huxton
Date:
Subject: Re: indexes