Re: Yes, pg does triggers first before asserting check constraints! Was Re: why vacuum
В списке pgsql-sql по дате отправления:
| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера