Re: fix and document CLUSTER privileges

From: Gilles Darold <gilles(at)migops(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Gilles Darold <gilles(at)migops(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: fix and document CLUSTER privileges
Date: 2023-01-11 13:22:26
Message-ID: 5a41a4cb-37e9-c169-baff-311941df5a86@migops.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le 06/01/2023 à 01:26, Nathan Bossart a écrit :
> Apparently I forgot to run all the tests before posting v4. Here is a new
> version of the patch that should pass all tests.

Review status:

The patch applies and compiles without issues, make check and
checkinstall tests are running without error.

It aim to limit the permission check to run the CLUSTER command on a
partition to ownership and the MAINTAIN privilege. Which it actually does.

In commit 3f19e17, to have CLUSTER ignore partitions not owned by
caller, there was still a useless check of database ownership or shared
relation in get_tables_to_cluster_partitioned().

Documentation have been updated to explain the conditions of a
successful execution of the CLUSTER command.

Additionally this patch also adds a warning when a partition is skipped
due to lack of permission just like VACUUM is doing:

    WARNING:  permission denied to vacuum "ptnowner2", skipping it

with CLUSTER now we have the same message:

    WARNING:  permission denied to cluster "ptnowner2", skipping it

Previous behavior was to skip the partition silently.

Tests on the CLUSTER command have been modified to skip warning messages
except partially in src/test/regress/sql/cluster.sql to validate the
presence of the warning.

I'm moving this commitfest entry to Ready for Committers.

Regards,

--
Gilles Darold

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2023-01-11 13:29:18 Re: Add a new pg_walinspect function to extract FPIs from WAL records
Previous Message torikoshia 2023-01-11 12:55:30 Re: [PATCH] support tab-completion for single quote input with equal sign