"Bath, David" <dave.bath@unix.net> writes:
> you wrote (2005-10-26 17:00)
>>> Sybase/MS-SQL's check constraint model asserts the constraint
>>> BEFORE the trigger, which discourages you from attempting to>
>>> check and handle meaning of data!
>> Er, doesn't PG do it that way too?
> Well, it works for me!
You're right of course. I was confusing this with a related problem
that people occasionally complain about, which is that datatype-related
errors are thrown before the trigger can do anything about them. For
instance, you can't stuff "abc" into a int4 field and hope that the
trigger will have a chance to replace it with something valid. (Yes,
people have asked for that :-() A less silly example is that domain
constraints on a field of a domain type get checked before the trigger
can run.
regards, tom lane