From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix tablespace handling for partitioned tables
Date: Mon, 17 Dec 2018 18:44:51 +0000
Message-ID: <E1gYxsp-0002m8-5f@gemulon.postgresql.org> (raw)
Fix tablespace handling for partitioned tables
When partitioned tables were introduced, we failed to realize that by
copying the tablespace handling for other relation kinds with no
physical storage we were causing the secondary effect that their
partitions would not automatically inherit the tablespace setting. This
is surprising and unhelpful, so change it to adopt the behavior
introduced in pg11 (commit 33e6c34c3267) for partitioned indexes: the
parent relation remembers the tablespace specification, which is then
used for any new partitions that don't declare one.
Because this commit changes behavior of the TABLESPACE clause for
partitioned tables (it's no longer a no-op), it is not backpatched.
Author: David Rowley, Álvaro Herrera
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/CAKJS1f9SxVzqDrGD1teosFd6jBMM0UEaa14_8mRvcWE19Tu0hA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ca4103025dfe26eaaf6a500dec9170fbb176eebc
Modified Files
--------------
doc/src/sgml/ref/create_table.sgml | 6 +-
src/backend/catalog/heap.c | 6 +-
src/backend/commands/tablecmds.c | 152 +++++++++++++++++++-----------
src/include/catalog/pg_class.h | 13 +++
src/test/regress/input/tablespace.source | 12 +++
src/test/regress/output/tablespace.source | 19 ++++
6 files changed, 147 insertions(+), 61 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: alvherre@alvh.no-ip.org
Subject: Re: pgsql: Fix tablespace handling for partitioned tables
In-Reply-To: <E1gYxsp-0002m8-5f@gemulon.postgresql.org>
References: <E1gYxsp-0002m8-5f@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