Re: pg_dump problem with dropped NOT NULL on child table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump problem with dropped NOT NULL on child table
Дата
Msg-id 25783.1452717132@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_dump problem with dropped NOT NULL on child table  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Ответы Re: pg_dump problem with dropped NOT NULL on child table  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
Karsten Hilbert <Karsten.Hilbert@gmx.net> writes:
> Please consider the following:

>     create table parent (
>         not_null_in_parent integer not null
>     );

>     create table child() inherits (parent);
>     alter table child
>         alter column not_null_in_parent
>             drop not null
>     ;

> Is this a bug or am I doing things I shouldn't hope work ?

You should not expect this to work; sooner or later we will make
the backend reject it.  See
http://www.postgresql.org/message-id/21633.1448383428@sss.pgh.pa.us

Alvaro or someone had a WIP patch to track NOT NULL constraints in
pg_constraint, which is the bookkeeping we'd need to deal with this
sort of thing properly.  I'm not sure what the status of it is.

In the meantime, you could get the effect you want if the parent
were marked with CHECK (not_null_in_parent IS NOT NULL) NO INHERIT.

            regards, tom lane


В списке pgsql-general по дате отправления:

Предыдущее
От: jwiencek3@comcast.net
Дата:
Сообщение: Synchronous replication
Следующее
От: "drum.lucas@gmail.com"
Дата:
Сообщение: Re: New Slave - timeline ERROR