Re: ALTER TABLE...ALTER COLUMN vs inheritance
От | Tom Lane |
---|---|
Тема | Re: ALTER TABLE...ALTER COLUMN vs inheritance |
Дата | |
Msg-id | 15656.1257346647@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | ALTER TABLE...ALTER COLUMN vs inheritance (Bernd Helmle <mailings@oopsware.de>) |
Ответы |
Re: ALTER TABLE...ALTER COLUMN vs inheritance
Re: ALTER TABLE...ALTER COLUMN vs inheritance Re: ALTER TABLE...ALTER COLUMN vs inheritance |
Список | 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 по дате отправления: