From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Have CLUSTER ignore partitions not owned by caller
Date: Thu, 14 Apr 2022 20:23:03 +0000
Message-ID: <E1nf5zb-000Wt5-Na@gemulon.postgresql.org> (raw)
Have CLUSTER ignore partitions not owned by caller
If a partitioned table has partitions owned by roles other than the
owner of the partitioned table, don't include them in the to-be-
clustered list. This is similar to what VACUUM FULL does (except we do
it sooner, because there is no reason to postpone it). Add a simple
test to verify that only owned partitions are clustered.
While at it, change memory context switch-and-back to occur once per
partition instead of outside of the loop.
Author: Justin Pryzby <pryzby@telsasoft.com>
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/20220411140609.GF26620@telsasoft.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3f19e176ae0f55a653d62e1504dbe5ad8c1006a0
Modified Files
--------------
src/backend/commands/cluster.c | 19 ++++++++++++-------
src/test/regress/expected/cluster.out | 25 +++++++++++++++++++++++++
src/test/regress/sql/cluster.sql | 19 +++++++++++++++++++
3 files changed, 56 insertions(+), 7 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: Have CLUSTER ignore partitions not owned by caller
In-Reply-To: <E1nf5zb-000Wt5-Na@gemulon.postgresql.org>
References: <E1nf5zb-000Wt5-Na@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