inherited primary key misbehavior

Поиск
Список
Период
Сортировка
От Amit Langote
Тема inherited primary key misbehavior
Дата
Msg-id c1c9b688-b886-84f7-4048-1e4ebe9b1d06@lab.ntt.co.jp
обсуждение исходный текст
Ответы Re: inherited primary key misbehavior  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi,

It seems that ATExecDetachPartition misses to mark a child's primary key
constraint entry (if any) as local (conislocal=true, coninhcount=0), which
causes this:

create table p (a int primary key) partition by list (a);
create table p2 partition of p for values in (2);
alter table p detach partition p2;
alter table p2 drop constraint p2_pkey ;
ERROR:  cannot drop inherited constraint "p2_pkey" of relation "p2"

select conname, conislocal, coninhcount from pg_constraint where conrelid
= 'p2'::regclass;
 conname │ conislocal │ coninhcount
─────────┼────────────┼─────────────
 p2_pkey │ f          │           1
(1 row)

How about the attached patch?

Thanks,
Amit

Вложения

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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: pg_dump multi VALUES INSERT
Следующее
От: Chris Travers
Дата:
Сообщение: Re: Proposal for Signal Detection Refactoring