Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

Next:From: Lee HarrDate: 2001-07-19 21:11:54
Subject: Re: performance
Previous:From: Tom LaneDate: 2001-07-19 18:58:40
Subject: libpgtcl and TCL_ARRAYS

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group