Re: Can not drop partition if exist foreign keys

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Can not drop partition if exist foreign keys
Дата
Msg-id 4734b034a623e8fa9d7522e4b4b7995cd1f3728f.camel@cybertec.at
обсуждение исходный текст
Ответ на Can not drop partition if exist foreign keys  (Олег Самойлов <splarv@ya.ru>)
Список pgsql-general
On Wed, 2023-10-11 at 14:08 +0300, Олег Самойлов 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.

That is working as designed.  You cannot detach a partition of a table if a
foreign key points to it.

Create the foreign key constraints between the partitions instead.

Yours,
Laurenz Albe



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Can not drop partition if exist foreign keys
Следующее
От: "Zwettler Markus (OIZ)"
Дата:
Сообщение: moving data with pg_dump/pg_restore between database with different locale