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 1p2Hxo-0006ci-4v for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Dec 2022 20:21:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2Hxn-0007C6-1u for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Dec 2022 20:21:19 +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 1p2Hxm-0007Bi-Hu for pgsql-hackers@lists.postgresql.org; Mon, 05 Dec 2022 20:21:18 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2Hxf-0005UY-A3 for pgsql-hackers@postgresql.org; Mon, 05 Dec 2022 20:21:17 +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 7D8A421C073B; Mon, 5 Dec 2022 23:21:08 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1670271668; bh=w8rH/Ixf6O33M0bpPEDoaVglPBG348u2or02/D0EtNI=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=QCCLKv3cBAs/Hv8vM9PXpFmD8H/B3n3WWuoaTwCvRRDG503fnMRFrfXXqHU9Z5XRF APiZxBk8wUgFemYbtjyxKfngqdUgwcvQayhjeQARzNtsMOdCERE1+w7i1IIUgyMmHk zb+qSJKTzD/Nrhb3ct9+Fc+1m8FyvK2A2sbtz8OI= Message-ID: Date: Mon, 5 Dec 2022 23:21:08 +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: predefined role(s) for VACUUM and ANALYZE Content-Language: en-US To: Andrew Dunstan , Nathan Bossart Cc: Corey Huinker , Tom Lane , Stephen Frost , Bharath Rupireddy , "David G. Johnston" , Kyotaro Horiguchi , Michael Paquier , Robert Haas , "pgsql-hackers@postgresql.org" References: <20220930231834.GA366260@nathanxps13> <20221114234004.GA1771874@nathanxps13> <20221115050813.GA1953731@nathanxps13> <287b17b8-92f3-2bc2-6bcf-31dc1305b65a@dunslane.net> <20221117043952.GA116054@nathanxps13> <20221118170504.GA401589@nathanxps13> <20221119185004.GA539143@nathanxps13> <20221120165713.GA597801@nathanxps13> <0b00a6ff-1475-c0ba-15ec-5b5e381c6359@dunslane.net> <20221123235444.GA479104@nathanxps13> <8609e4f7-5ffd-9fef-a5e0-78edb8818f3c@dunslane.net> From: Pavel Luzanov In-Reply-To: <8609e4f7-5ffd-9fef-a5e0-78edb8818f3c@dunslane.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, While looking into the new feature, I found the following situation with the \dp command displaying privileges on the system tables: GRANT VACUUM, ANALYZE ON TABLE pg_type TO alice; SELECT relacl FROM pg_class WHERE oid = 'pg_type'::regclass;                            relacl -------------------------------------------------------------  {=r/postgres,postgres=arwdDxtvz/postgres,alice=vz/postgres} (1 row) But the \dp command does not show the granted privileges: \dp pg_type                             Access privileges  Schema | Name | Type | Access privileges | Column privileges | Policies --------+------+------+-------------------+-------------------+---------- (0 rows) The comment in src/bin/psql/describe.c explains the situation:     /*      * Unless a schema pattern is specified, we suppress system and temp      * tables, since they normally aren't very interesting from a permissions      * point of view.  You can see 'em by explicit request though, eg with \z      * pg_catalog.*      */ So to see the privileges you have to explicitly specify the schema name: \dp pg_catalog.pg_type                                      Access privileges    Schema   |  Name   | Type  |      Access privileges      | Column privileges | Policies ------------+---------+-------+-----------------------------+-------------------+----------  pg_catalog | pg_type | table | =r/postgres +|                   |             |         |       | postgres=arwdDxtvz/postgres+|                   |             |         |       | alice=vz/postgres |                   | (1 row) But perhaps this behavior should be reviewed or at least documented? ----- Pavel Luzanov