Re: Can not drop partition if exist foreign keys

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Can not drop partition if exist foreign keys
Дата
Msg-id 202310111117.cdj4ngpfrppg@alvherre.pgsql
обсуждение исходный текст
Ответ на Can not drop partition if exist foreign keys  (Олег Самойлов <splarv@ya.ru>)
Список pgsql-general
On 2023-Oct-11, Олег Самойлов wrote:

> There are two common practice to drop partition from partitioned
> table: just drop or detach-drop. But simple drop don't work if exist
> foreign key. Example script attached.

Yeah.  Detach it first, then you should be able to drop it.

> psql:test.sql:15: ERROR:  cannot drop table parent_0 because other objects depend on it
> DETAIL:  constraint children_id_fkey on table children depends on table parent_0
> HINT:  Use DROP ... CASCADE to drop the dependent objects too.
> 
> Looked like a bug.

We tried to make DROP work, but we didn't find a way.  Patches welcome.

-- 
Álvaro Herrera



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

Предыдущее
От: Олег Самойлов
Дата:
Сообщение: Can not drop partition if exist foreign keys
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Can not drop partition if exist foreign keys