Dmitry Tkach <dmitry@openratings.com> writes:
> Something like
> insert into test
> select null,null union select 1,2 where false
> has the same problem... and it doesn't refer to any relations.
But that's parsed as
insert into test
(select null,null) union (select 1,2 where false)
so I'd expect it to bomb if test has NOT NULL constraints.
> Not just 7.2... I was testing this in 7.3 - it has the same problem
Yeah, the change is post-7.3.
> insert into test select * from (select null,null union select 1,2 where
> false) as dummy
> ... that works fine.
I get
ERROR: ExecInsert: Fail to add null value in not null attribute x
which is what I'd expect.
regards, tom lane