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.