Дмитрий Дегтярёв <degtyaryov@gmail.com> writes:
> However, in accordance with the documentation
> http://www.postgresql.org/docs/9.4/static/ddl-inherit.html(quote: "It must
> also include check constraints with the same names and check expressions as
> those of the parent."),
> alter table t2 alter column a drop not null;
> the result must be a error.
Ah. Yeah, that's a known issue: NOT NULL constraints don't currently have
enough infrastructure for ALTER TABLE to realize whether they're inherited
or not. The system should indeed prevent you from doing DROP NOT NULL
here, but it doesn't. I think there's an item for that on the TODO list.
regards, tom lane