Re: fix and document CLUSTER privileges - Mailing list pgsql-hackers

From Gilles Darold
Subject Re: fix and document CLUSTER privileges
Date
Msg-id 5a41a4cb-37e9-c169-baff-311941df5a86@migops.com
Whole thread Raw
In response to Re: fix and document CLUSTER privileges  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: fix and document CLUSTER privileges
List 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




pgsql-hackers by date:

Previous
From: torikoshia
Date:
Subject: Re: [PATCH] support tab-completion for single quote input with equal sign
Next
From: Bharath Rupireddy
Date:
Subject: Re: Add a new pg_walinspect function to extract FPIs from WAL records