Re: ALTER TABLE ... DETACH PARTITION just sitting there

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ALTER TABLE ... DETACH PARTITION just sitting there
Дата
Msg-id 342541.1624914966@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ALTER TABLE ... DETACH PARTITION just sitting there  (Ron <ronljohnsonjr@gmail.com>)
Ответы Re: ALTER TABLE ... DETACH PARTITION just sitting there
Список pgsql-general
Ron <ronljohnsonjr@gmail.com> writes:
> AWS RDS Postgresql 12.5.

> We've got a table partitioned by month range (FOR VALUES FROM ('2011-07-01')
> TO (2011-08-01')), and I've been detaching partitions from oldest to newest,
> one at a time. Whenever it's failed due to a FK constraint (and there are
> many of them!), I dropped the "same month" partition from TABLE_B, and then
> returned and dropped the partition from TABLE_A.

> But now, after 17 dropped partitions it's just sitting there on "ALTER TABLE
> table_a DROP PARTITION table_a_p2011_07;"  I'm the only user on this test
> instance, and validated that nothing else is blocking me.

> Are the FK validations what's causing the apparent "hang"?  (EXPLAIN ALTER
> TABLE... does not work.)

Perhaps the corresponding TABLE_B partition lacks an index on the
referencing column?  I've not looked at how this particular case
is implemented, but typically, lack of such an index is fine
until you try to delete PK-side rows.

            regards, tom lane



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

Предыдущее
От: Ron
Дата:
Сообщение: ALTER TABLE ... DETACH PARTITION just sitting there
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: ALTER TABLE ... DETACH PARTITION just sitting there