Re: Isolation / Visibility inside a trigger

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Jorge Godoy <jgodoy(at)gmail(dot)com>
Cc: PostgreSQL General ML <pgsql-general(at)postgresql(dot)org>
Subject: Re: Isolation / Visibility inside a trigger
Date: 2006-11-03 13:36:37
Message-ID: 20061103133637.GD27350@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jorge Godoy 2006-11-03 13:48:55 Re: Isolation / Visibility inside a trigger
Previous Message Shane Ambler 2006-11-03 13:28:28 Re: Cannot rename file pg_xlog\0000.....