Re: message for constraint

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: message for constraint
Дата
Msg-id 200601141013.47717.peter_e@gmx.net
обсуждение исходный текст
Ответ на message for constraint  (Jaime Casanova <systemguards@gmail.com>)
Ответы Re: message for constraint  (Jaime Casanova <systemguards@gmail.com>)
Список pgsql-hackers
Jaime Casanova wrote:
> From time to time people ask me if there is a way to "customize"
> messages for constraints so they could be more informative to the
> user...

What about this?

=> create table foo (fld int4 constraint "fld must contain positive numbers" check (fld > 0));
CREATE TABLE
=> insert into foo values (-5);
ERROR:  new row for relation "foo" violates check constraint "fld must contain positive numbers"

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


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

Предыдущее
От: Jaime Casanova
Дата:
Сообщение: message for constraint
Следующее
От: Leandro Guimarães Faria Corcete DUTRA
Дата:
Сообщение: Surrogate keys (Was: enums)