Re: [SQL] Constraint Problem - Mailing list pgsql-sql

From Gerhard Dieringer
Subject Re: [SQL] Constraint Problem
Date
Msg-id s7f35bb3.046@kopo001
Whole thread Raw
List 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 by date:

Previous
From: "Safa Pilavcý"
Date:
Subject: Fw: CONTAINS keyword
Next
From: "Safa Pilavcý"
Date:
Subject: Re: [SQL] Fw: CONTAINS keyword