Re: fix and document CLUSTER privileges

From: Gilles Darold <gilles(at)migops(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: fix and document CLUSTER privileges
Date: 2023-01-04 13:25:13
Message-ID: 79ea98ff-3bd7-03ff-be40-70e851c38640@migops.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le 16/12/2022 à 05:57, Nathan Bossart a écrit :
> Here is a new version of the patch. I've moved the privilege checks to a
> new function, and I added a note in the docs about clustering partitioned
> tables in a transaction block (it's not allowed).
>

Getting into review of this patch I wonder why the CLUSTER command do
not react as VACUUM FULL command when there is insuffisant privileges.
For example with a partitioned table (ptnowner) and two partitions
(ptnowner1 and ptnowner2) with the second partition owned by another
user, let' say usr2. We have the following report when executing vacuum
as usr2:

testdb=> VACUUM FULL ptnowner;
WARNING:  permission denied to vacuum "ptnowner", skipping it
WARNING:  permission denied to vacuum "ptnowner1", skipping it
VACUUM

Here only ptnowner2 have been vacuumed which is correct and expected.

For the cluster command:

testdb=> CLUSTER;
CLUSTER

I would have expected something like:

testdb=> CLUSTER;
WARNING:  permission denied to cluster "ptnowner1", skipping it
CLUSTER

I mean that the silent behavior is not very helpful.

This is the current behavior of the CLUSTER command and current patch
adds a sentence about the silent behavior in the documentation. This is
good but I just want to ask if we could want to fix this behavior too or
just keep things like that with the lack of noise.

Best regards,

--
Gilles Darold

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2023-01-04 13:29:24 Re: Perform streaming logical transactions by background workers and parallel apply
Previous Message Amit Kapila 2023-01-04 13:10:41 Re: Perform streaming logical transactions by background workers and parallel apply