Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently
От | Alexander Lakhin |
---|---|
Тема | Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently |
Дата | |
Msg-id | 91a6d779-126b-734c-5f73-e9282a3405a5@gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently (Kyotaro Horiguchi <horikyota.ntt@gmail.com>) |
Список | pgsql-bugs |
Hello Michael and Kyotaro-san, 21.12.2021 06:03, Kyotaro Horiguchi wrote: >> This would also fail when attempting to detach a foreign table, as >> well, and these are legal relkinds in a partition tree. Once we do >> that, we fall down into the same failure as for the non-concurrent >> mode in RemoveInheritance(), telling that the relation is not a member >> of the partition tree. > I agree to the discussion above thus it seems to me right that we just > remove the assertion. We never have a partition of un-attachable > relkind so such kind of relations are surely rejected just after. The > assertion on "== RELKIND_PARTITIONED_TABLE" is still valid since we > don't reach there for the case of the traditional inheritance. > > As detaching a foreign table is a valid scenario (not covered before), maybe it's worth to exercise it as following: --- a/contrib/postgres_fdw/sql/postgres_fdw.sql +++ b/contrib/postgres_fdw/sql/postgres_fdw.sql @@ -1490,6 +1490,8 @@ CREATE FOREIGN TABLE foreign_tbl (a int, b int) CREATE TABLE parent_tbl (a int, b int) PARTITION BY RANGE(a); ALTER TABLE parent_tbl ATTACH PARTITION foreign_tbl FOR VALUES FROM (0) TO (100); +ALTER TABLE parent_tbl DETACH PARTITION foreign_tbl CONCURRENTLY; +ALTER TABLE parent_tbl ATTACH PARTITION foreign_tbl FOR VALUES FROM (0) TO (100); CREATE VIEW rw_view AS SELECT * FROM parent_tbl WHERE a < b WITH CHECK OPTION; Thanks! Best regards, Alexander
В списке pgsql-bugs по дате отправления: