Re: Yes, pg does triggers first before asserting check constraints! Was Re: why vacuum

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Yes, pg does triggers first before asserting check constraints! Was Re: why vacuum
Дата
Msg-id 13074.1130374531@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Yes, pg does triggers first before asserting check constraints! Was Re: why vacuum  ("Bath, David" <dave.bath@unix.net>)
Список pgsql-sql
"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


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Bath, David"
Дата:
Сообщение: Yes, pg does triggers first before asserting check constraints! Was Re: why vacuum
Следующее
От: Igor Shevchenko
Дата:
Сообщение: Re: why vacuum