Re: Own messages for constraints? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Own messages for constraints?
Date
Msg-id 20070319182215.GA387@svana.org
Whole thread Raw
In response to Re: Own messages for constraints?  ("hubert depesz lubaczewski" <depesz@gmail.com>)
Responses Re: Own messages for constraints?
List pgsql-general
On Mon, Mar 19, 2007 at 07:08:41PM +0100, hubert depesz lubaczewski wrote:
> On 3/19/07, Jeff Davis <pgsql@j-davis.com> wrote:
> >You can use an AFTER trigger instead of a CHECK constraint (but that may
> >have a performance impact - test for your application).
>
> are you sure you meant AFTER? why? generally data-checks should be in
> before triggers. i guess.

In an AFTER trigger you can be sure you're seeing what actually got
inserted. In a BEFORE trigger other triggers after you could still
modify the data...

Have a nice day,
--
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: "Andrej Ricnik-Bay"
Date:
Subject: Re: UPGRADATION TO 8.1
Next
From: "hubert depesz lubaczewski"
Date:
Subject: Re: Own messages for constraints?