postgresql/contrib/postgres_fdw
Michael Paquier 2e577c9446 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
2021-12-22 15:38:00 +09:00
..
expected Remove assertion for ALTER TABLE .. DETACH PARTITION CONCURRENTLY 2021-12-22 15:38:00 +09:00
sql Remove assertion for ALTER TABLE .. DETACH PARTITION CONCURRENTLY 2021-12-22 15:38:00 +09:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
connection.c postgres_fdw: Report warning when timeout expires while getting query result. 2021-12-08 23:31:46 +09:00
deparse.c postgres_fdw: suppress casts on constants in limited cases. 2021-11-12 11:50:47 -05:00
Makefile postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
option.c Add missing EmitWarningsOnPlaceholders() calls. 2021-12-21 12:12:24 -05:00
postgres_fdw--1.0--1.1.sql postgres_fdw: Add functions to discard cached connections. 2021-01-26 15:35:54 +09:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c Remove PF_USED_FOR_ASSERTS_ONLY from variables in general use 2021-11-30 14:02:14 +01:00
postgres_fdw.control postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
postgres_fdw.h postgres_fdw: Allow application_name of remote connection to be set via GUC. 2021-09-07 12:27:30 +09:00
shippable.c Replace remaining uses of "whitelist". 2021-01-05 14:00:16 +13:00