aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-12-22 15:38:00 +0900
committerMichael Paquier <michael@paquier.xyz>2021-12-22 15:38:00 +0900
commit2e577c94466fde77d24cd44dc47059cf9cf392a4 (patch)
tree3d5f69b185cd0f1d4e92c509a4cd97b7a625d7a1 /src/backend/commands/tablecmds.c
parentcc8b25712b5ed8809048c7e209882bb0981214d6 (diff)
downloadpostgresql-2e577c94466fde77d24cd44dc47059cf9cf392a4.tar.gz
postgresql-2e577c94466fde77d24cd44dc47059cf9cf392a4.zip
Remove assertion for ALTER TABLE .. DETACH PARTITION CONCURRENTLY
One code path related to this flavor of ALTER TABLE was checking that the relation to detach has to be a normal table or a partitioned table, which would fail if using the command with a different relation kind. Views, sequences and materialized views cannot be part of a partition tree, so these would cause the command to fail anyway, but the assertion was triggered. Foreign tables can be part of a partition tree, and again the assertion would have failed. The simplest solution is just to remove this assertion, so as we get the same failure as the non-concurrent code path. While on it, add a regression test in postgres_fdw for the concurrent partition detach of a foreign table, as per a suggestion from Alexander Lakhin. Issue introduced in 71f4c8c. Reported-by: Alexander Lakhin Author: Michael Paquier, Alexander Lakhin Reviewed-by: Peter Eisentraut, Kyotaro Horiguchi Discussion: https://postgr.es/m/17339-a9e09aaf38a3457a@postgresql.org Backpatch-through: 14
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index bf42587e383..45e59e3d5c6 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -15013,8 +15013,6 @@ MarkInheritDetached(Relation child_rel, Relation parent_rel)
HeapTuple inheritsTuple;
bool found = false;
- Assert(child_rel->rd_rel->relkind == RELKIND_RELATION ||
- child_rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
Assert(parent_rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
/*