Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently
Дата
Msg-id YcB5K6/Mrh9X82lG@paquier.xyz
обсуждение исходный текст
Ответ на BUG #17339: Assert failed on attempt to detach a sequence concurrently  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-bugs
On Sun, Dec 19, 2021 at 06:00:02AM +0000, PG Bug reporting form wrote:
> CREATE SEQUENCE seq;
> CREATE TABLE range_parted(a int) PARTITION BY RANGE(a);
> ALTER TABLE range_parted DETACH PARTITION seq CONCURRENTLY;

The same error happens additionally for views or materialized views.
Looking at the code, I think that we should just apply
ATSimplePermissions() on (ATT_TABLE | ATT_FOREIGN_TABLE) when
executing the detach command to check for the supported relkinds.
That would make the logic consistent with the attach code path that
does the same check on the partition attached, while generating an
error message already generic enough for this purpose.

Attached is a patch, with some regression tests.
--
Michael

Вложения

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17340: Unnest discards rows with empty or null arrays
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently