Re: [SQL] Constraint Problem

From: "Gerhard Dieringer" <DieringG(at)eba-haus(dot)de>
To: "<"<pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] Constraint Problem
Date: 1999-09-30 10:46:26
Message-ID: s7f35bb3.046@kopo001
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Safa Pilavc 1999-09-30 12:06:33 Re: [SQL] Fw: CONTAINS keyword
Previous Message Safa Pilavc 1999-09-30 10:24:13 Fw: CONTAINS keyword