Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2pAp-0003ON-2T for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 07:48:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2pAn-0002g5-4T for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 07:48:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2pAm-0002fn-Ld for pgsql-hackers@lists.postgresql.org; Wed, 07 Dec 2022 07:48:56 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2pAj-0007AB-HO for pgsql-hackers@postgresql.org; Wed, 07 Dec 2022 07:48:55 +0000 Received: from [192.168.0.104] (unknown [62.217.188.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id CC98A21C23F7; Wed, 7 Dec 2022 10:48:50 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1670399330; bh=10u66InlpEfLeNTVD8we4weybSl0dkxfWgtTVoc1u3o=; h=Date:Subject:To:References:From:In-Reply-To; b=JLMMSVM4hLPp8ZFsz5ICKfVJfrtM8IizserrgmM2OTI/2GYYyAgRgsHuI6PphmsqT /f9A/UsA53+QJ+Jw+2BsiQC4842+SiODda+rvlFUvsGIT2sQSunXYC2kPihu722Yka t0ZfqOI4Qd54dagKEppCX3J0yvfEg/oY/Rg7qhes= Message-ID: <661148f4-c7f1-dec1-2bc8-29f3bd58e242@postgrespro.ru> Date: Wed, 7 Dec 2022 10:48:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: add \dpS to psql Content-Language: en-US To: Nathan Bossart , pgsql-hackers@postgresql.org References: <20221206193606.GB3078082@nathanxps13> From: Pavel Luzanov In-Reply-To: <20221206193606.GB3078082@nathanxps13> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 06.12.2022 22:36, Nathan Bossart wrote: > As discussed elsewhere [0], \dp doesn't show privileges on system objects, > and this behavior is not mentioned in the docs. I've attached a small > patch that adds support for the S modifier (i.e., \dpS) and the adjusts the > docs. > > Thoughts? > > [0] https://postgr.es/m/a2382acd-e465-85b2-9d8e-f9ed1a5a66e9%40postgrespro.ru A few words in support of this patch, since I was the initiator of the discussion. Before VACUUM, ANALYZE privileges, there was no such question. Why check privileges on system catalog objects? But now it doesn't. It is now possible to grant privileges on system tables, so it should be possible to see privileges with psql commands. However, the \dp command does not support the S modifier, which is inconsistent. Furthermore. The VACUUM privilege allows you to also execute VACUUM FULL. VACUUM and VACUUM FULL are commands with similar names, but work completely differently. It may be worth clarifying on this page: https://www.postgresql.org/docs/devel/ddl-priv.html Something like: Allows VACUUM on a relation, including VACUUM FULL. But that's not all. There is a very similar command to VACUUM FULL with a different name - CLUSTER. The VACUUM privilege does not apply to the CLUSTER command. This is probably correct. However, the documentation for the CLUSTER command does not say who can perform this command. I think it would be correct to add a sentence to the Notes section (https://www.postgresql.org/docs/devel/sql-cluster.html) similar to the one in the VACUUM documentation: "To cluster a table, one must ordinarily be the table's owner or a superuser." Ready to participate, if it seems reasonable. -- Pavel Luzanov Postgres Professional: https://postgrespro.com