Re: not null constraints, again

Поиск
Список
Период
Сортировка
От jian he
Тема Re: not null constraints, again
Дата
Msg-id CACJufxG=M-8kY-9LmapFWipS8LzYoheBR+r58z_=kJmvT59sew@mail.gmail.com
обсуждение исходный текст
Ответ на Re: not null constraints, again  (jian he <jian.universality@gmail.com>)
Список pgsql-hackers
tricky case:
drop table if exists part, part0 cascade;
create table part (a int not null) partition by range (a);
create table part0 (a int primary key);
alter table part attach partition part0 for values from (0) to (1000);
alter table ONLY part add primary key(a);
alter table ONLY part drop constraint part_a_not_null;
-- alter table ONLY part alter column a drop not null;


Now we are in a state where a partitioned
table have a primary key but doesn't have a not-null constraint for it.

select  indisunique, indisprimary, indimmediate,indisvalid
from    pg_index
where   indexrelid = 'part_pkey'::regclass;

shows this primary key index is invalid.

but
select conname,contype,convalidated
from pg_constraint where conname = 'part_pkey';

shows this primary key constraint is valid.



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