Re: ALTER TABLE...ALTER COLUMN vs inheritance - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER TABLE...ALTER COLUMN vs inheritance
Date
Msg-id 15656.1257346647@sss.pgh.pa.us
Whole thread Raw
In response to ALTER TABLE...ALTER COLUMN vs inheritance  (Bernd Helmle <mailings@oopsware.de>)
Responses Re: ALTER TABLE...ALTER COLUMN vs inheritance
Re: ALTER TABLE...ALTER COLUMN vs inheritance
Re: ALTER TABLE...ALTER COLUMN vs inheritance
List pgsql-hackers
Bernd Helmle <mailings@oopsware.de> writes:
> Consider the following workflow:

> CREATE TABLE foo(id integer NOT NULL, val text NOT NULL);
> CREATE TABLE foo2(another_id integer NOT NULL) INHERITS(foo);

> Now someone decides he doesn't want the NOT NULL constraint on the 
> inherited column "val" anymore:

> ALTER TABLE foo2 ALTER COLUMN val DROP NOT NULL;

Yeah, this is a known issue.  The ALTER should be rejected, but it is
not, because we don't have enough infrastructure to notice that the
constraint is inherited and logically can't be dropped.  I think the
consensus was that the way to fix this (along with some other problems)
is to start representing NOT NULL constraints in pg_constraint, turning
attnotnull into just a bit of denormalization for performance.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: PL/Python array support
Next
From: Pavel Stehule
Date:
Subject: actualised funcs typmod patch