Re: abnormal behaviour of a CHECK CONSTRAINT with a regular expression when a trigger is added

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: abnormal behaviour of a CHECK CONSTRAINT with a regular expression when a trigger is added
Дата
Msg-id 15682.1076430195@sss.pgh.pa.us
обсуждение исходный текст
Ответ на abnormal behaviour of a CHECK CONSTRAINT with a regular expression when a trigger is added  (Daniel Struck <struck.d@retrovirology.lu>)
Ответы Re: abnormal behaviour of a CHECK CONSTRAINT with a regular  (Daniel Struck <struck.d@retrovirology.lu>)
Список pgsql-bugs
Daniel Struck <struck.d@retrovirology.lu> writes:
> This makes it also impossible to change the type of a value by a trigger?

Correct.  It is annoying in some cases, but if the input to the trigger
isn't of the column datatype, then what type is it?  It's hard to see
how that could work in general.

If you want, say, a varchar length constraint to be checked only after
the trigger runs, I'd counsel declaring the column as plain text and
writing the length test as a CHECK constraint.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: abnormal behaviour of a CHECK CONSTRAINT with a regular expression when a trigger is added
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: abnormal behaviour of a CHECK CONSTRAINT with a regular