pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix tablespace handling in MERGE/SPLIT partition commands.
Date: Mon, 15 Jul 2024 04:17:29 +0000
Message-ID: <E1sTD9V-001i3X-QY@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c0868966253218d83caeeac4bfd92ca6f4994537

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml             |  6 ++++--
src/backend/commands/tablecmds.c              |  2 +-
src/test/regress/expected/partition_merge.out | 23 +++++++++++++++++++++++
src/test/regress/expected/partition_split.out | 26 ++++++++++++++++++++++++++
src/test/regress/sql/partition_merge.sql      | 12 ++++++++++++
src/test/regress/sql/partition_split.sql      | 13 +++++++++++++
6 files changed, 79 insertions(+), 3 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1sTD9V-001i3X-QY@gemulon.postgresql.org>
Permalink:  ../E1sTD9V-001i3X-QY@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sTD9V-001i3X-QY@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix tablespace handling in MERGE/SPLIT partition commands.
  In-Reply-To: <E1sTD9V-001i3X-QY@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox