Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2021-12-20T12:38:03Z
Lists: pgsql-bugs
Attachments
- partition-detach-assert.patch (text/x-diff) patch
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
Commits
-
Remove assertion for ALTER TABLE .. DETACH PARTITION CONCURRENTLY
- 8a22a40b2cfd 14.2 landed
- 2e577c94466f 15.0 landed