Re: [SQL] Constraint Problem

Поиск
Список
Период
Сортировка
От Gerhard Dieringer
Тема Re: [SQL] Constraint Problem
Дата
Msg-id s7f35bb3.046@kopo001
обсуждение исходный текст
Список pgsql-sql
Chairudin Sentosa wrote:

> ...
>  constraint ck_ngetest_disc_pin check
>     (disc_pin = 'Y' or
>      disc_pin = 'N')
> ...
> ...
> insert into ngetest
>(custnum, first_name, service_type, sex, detailed_bill, ngetest_status,disc_all)
>values (1,'Bob','Y','M','Y','A','Y');
>ERROR:  ExecAppend: rejected due to CHECK constraint ck_ngetest_disc_pin
>...

I am not sure, but I think the problem is, that you have no value for disc_pin in your insert, so it is NULL
but in your constraint ck_ngetest_disc_pin you only allow 'Y' or 'N' for this attribute.

The same problem ocures for the other inserts.

I hope this will help you.

Gerhard





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

Предыдущее
От: "Safa Pilavcý"
Дата:
Сообщение: Fw: CONTAINS keyword
Следующее
От: "Safa Pilavcý"
Дата:
Сообщение: Re: [SQL] Fw: CONTAINS keyword