Fix tablespace handling in MERGE/SPLIT partition commands.
authorFujii Masao <fujii@postgresql.org>
Mon, 15 Jul 2024 04:11:51 +0000 (13:11 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 15 Jul 2024 04:11:51 +0000 (13:11 +0900)
commitc0868966253218d83caeeac4bfd92ca6f4994537
tree780481d7c893ca2a14884413974c2822e3588ac5
parent069d0ff0226b9ac999030b894db8defd4df186e0
Fix tablespace handling in MERGE/SPLIT partition commands.

As commit ca4103025d stated, new partitions without a specified tablespace
should inherit the parent relation's tablespace. However, previously,
ALTER TABLE MERGE PARTITIONS and ALTER TABLE SPLIT PARTITION commands
always created new partitions in the default tablespace, ignoring
the parent's tablespace. This commit ensures new partitions inherit
the parent's tablespace.

Backpatch to v17 where these commands were introduced.

Author: Fujii Masao
Reviewed-by: Masahiko Sawada
Discussion: https://postgr.es/m/abaf390b-3320-40a5-8815-ef476db5cfe7@oss.nttdata.com
doc/src/sgml/ref/alter_table.sgml
src/backend/commands/tablecmds.c
src/test/regress/expected/partition_merge.out
src/test/regress/expected/partition_split.out
src/test/regress/sql/partition_merge.sql
src/test/regress/sql/partition_split.sql