check contraint allows illegal value?

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-bugs(at)postgresql(dot)org
Subject: check contraint allows illegal value?
Date: 2001-07-19 19:00:59
Message-ID: slrn9lebha.o1.lee@troll.east.rochester.k12.ny.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Is this a bug?

create table foo( c char(2)
check (c in ('09', '10', '11', '12', 'n/a'))
);
CREATE

insert into foo values('09');
INSERT

insert into foo values('10');
INSERT

insert into foo values('08');
ExecAppend: rejected due to CHECK constraint foo_c

insert into foo values('n/a');
ExecAppend: rejected due to CHECK constraint foo_c

clearly this was a 'whups' on my part, but it would have
been nice to know that my constraint was bogus at the
time the table was created.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Lee Harr 2001-07-19 21:11:54 Re: performance
Previous Message Tom Lane 2001-07-19 18:58:40 libpgtcl and TCL_ARRAYS