Re: Composite type versus Domain constraints.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Composite type versus Domain constraints.
Дата
Msg-id 29773.1113338933@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Composite type versus Domain constraints.  (James Robinson <jlrobins@socialserve.com>)
Ответы Re: Composite type versus Domain constraints.
Список pgsql-general
James Robinson <jlrobins@socialserve.com> writes:
> insert into simple_table values (null, '(43)'); -- GRR works!!! It'll
> let any smallint in. What happened to the constraint?

The composite-type input routine doesn't check any constraints ...
and that includes domains.  You can make it work if you don't use
a composite literal:

egression=# insert into simple_table values (null, row(43));
ERROR:  value for domain "simple" violates check constraint "limits"

Obviously this whole area needs improvement.  Domain constraints in
particular fail to be enforced in many places where they should be,
such as plpgsql variables.

            regards, tom lane

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

Предыдущее
От: James Robinson
Дата:
Сообщение: Composite type versus Domain constraints.
Следующее
От: Matt Van Mater
Дата:
Сообщение: psql vs perl prepared inserts