BUG #5053: domain constraints still leak - Mailing list pgsql-bugs

From Andrew Gierth
Subject BUG #5053: domain constraints still leak
Date
Msg-id 200909140203.n8E23roO012573@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5053: domain constraints still leak  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5053
Logged by:          Andrew Gierth
Email address:      andrew@tao11.riddles.org.uk
PostgreSQL version: 8.5devel
Operating system:   FreeBSD
Description:        domain constraints still leak
Details:

Domain NOT NULL constraints (and probably other constraints too) aren't
being enforced in some code paths. e.g.

\pset null '<NULL>'
create domain tstdom as integer not null;
create table test (a tstdom);
insert into test values (null);
ERROR:  domain tstdom does not allow null values

all correct up to now, but:

insert into test select (r).* from (select null::test as r) s;
INSERT 0 1

oops.

select * from test;
   a
--------
 <NULL>
(1 row)

pgsql-bugs by date:

Previous
From: Marek Wójtowicz
Date:
Subject: Re: BUG #5052: lost history
Next
From: Tom Lane
Date:
Subject: Re: BUG #5053: domain constraints still leak