Re: Isolation / Visibility inside a trigger - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Isolation / Visibility inside a trigger
Date
Msg-id 20061103133637.GD27350@svana.org
Whole thread Raw
In response to Re: Isolation / Visibility inside a trigger  (Jorge Godoy <jgodoy@gmail.com>)
Responses Re: Isolation / Visibility inside a trigger
List pgsql-general
On Fri, Nov 03, 2006 at 10:24:21AM -0300, Jorge Godoy wrote:
> But then, the answer to my question is that even inside the same transaction
> or receiving the NEW row those functions called by the trigger shouldn't see
> the information.  Did I get it right?

Correct. Before triggers happen prior to the backend even attampting to
insert. AIUI it happens before uniqueness checks, check constraints,
foreign key checks, etc. As far as anything else in the system is
concerned, the row does not exist yet.

If it's just the flag field that's being updated, perhaps you could
split the flags and result field into a seperate table updated by the
after trigger.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Shane Ambler
Date:
Subject: Re: Cannot rename file pg_xlog\0000.....
Next
From: Jorge Godoy
Date:
Subject: Re: Isolation / Visibility inside a trigger