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 1mk8Vf-00074U-8r for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Nov 2021 17:32:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mk8Ve-0004ed-08 for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Nov 2021 17:32:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mk8Vd-0004eU-MV for pgsql-hackers@lists.postgresql.org; Mon, 08 Nov 2021 17:32:41 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mk8Vb-0003h3-El for pgsql-hackers@postgresql.org; Mon, 08 Nov 2021 17:32:41 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id D9B345F7A2; Mon, 8 Nov 2021 12:32:38 -0500 (EST) Date: Mon, 8 Nov 2021 12:32:38 -0500 From: Stephen Frost To: Andres Freund Cc: Robert Haas , Jeff Davis , "Bossart, Nathan" , "pgsql-hackers@postgresql.org" , Alvaro Herrera , Bharath Rupireddy Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT. Message-ID: <20211108173238.GG20998@tamriel.snowman.net> References: <20211102182614.GC20998@tamriel.snowman.net> <20211104224636.5qg6cfyjkw52rh4d@alap3.anarazel.de> <20211107185049.6vzl4wskpa2tre3r@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qgNrgGfFsws9WDdn" Content-Disposition: inline In-Reply-To: <20211107185049.6vzl4wskpa2tre3r@alap3.anarazel.de> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qgNrgGfFsws9WDdn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Andres Freund (andres@anarazel.de) wrote: > On 2021-11-05 08:54:37 -0400, Robert Haas wrote: > > On Thu, Nov 4, 2021 at 6:46 PM Andres Freund wrote: > > > What about extending GRANT to allow to grant rights on commands? Yes,= it'd be > > > a bit of work to make that work in the catalogs, but it doesn't seem = too hard > > > to tackle. > >=20 > > I think that there aren't too many commands where the question is just > > whether you can execute the command or not. CHECKPOINT is one that > > does work that way, but if it's VACUUM or ANALYZE the question will be > > whether you can run it on a particular table; if it's ALTER SYSTEM it > > will be whether you can run it for that GUC; and so on. CHECKPOINT is > > one of the few commands that has no target. >=20 > I don't know if that's really such a big deal. It's useful to be able to = grant > the right to do a system wide ANALYZE etc to a role that can't otherwise = do > anything with the table. Even for ALTER SYSTEM etc it seems like it'd be > helpful, because it allows to constrain an admin tool to "legitimate" adm= in > paths, without allowing, say, UPDATE pg_proc. Note that it's already possible to have a non-superuser who can run VACUUM and ANALYZE on all non-shared tables in a database but who otherwise isn't able to mess with the tables owned by other users- that is something the database owner can do. Perhaps it's useful to break that out into a separately grantable permission but the argument should really by why you'd want to GRANT someone the ability to VACUUM/ANALYZE an entire database while *not* having them be the database owner. That's a much more narrow use-case vs. having them not be a superuser or be able to do things like UPDATE pg_proc. Thanks, Stephen --qgNrgGfFsws9WDdn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJhiV82AAoJEO1sijiDR2RV0a0P/ihzGuT1sHo0lNiCVPBUiz/u 8+ibVr0U31+nTBnzDoYsrs9HryueXEYeqEpOrMkxa7u2JuWG5322Pxosedx8l0KR 8orgUjT1rbqvzF9tPpULxus92bMoHF7sIC5Drj6H2XrxJTTGv95jKeNuXz1uW7BE CIx4gRTE0SNulpPgH4Ay6Ql5BNkrkFBm94wFcPReo1ygFpdHnYRDw9Ysw659nNfm AnWusweg9yr+fFxTYkNjdCyStaIPqnpl9pfIMuU1udn0Zc8HBkCtPoXeKccDRa2S yrCmHFDFyERBW0qNfNJDSQuKg1vOMLJKbKeJXTPAAxJpha+2o5+odz44fl9lJz8q iN0bQoh14Yzc3GtadkBwqUPPPFePmtEB65ZU0Dvq/o9gns1Yloa7zpHJxaMpjFEm qkudBS61YKA6f58vMQjZ4C58ql1jyhq0CnNWoJwUi0IAX43d5y4tRm4Bhcbydw94 W9iN5mOc+ZmyDa7QTJ+RoDIIeUlOX68uOdLtx4M38WcDyCPti2378mszgP7dNald 24w1fIpUwL2AEYA0wmTQX1EKop5Xfpo9b2oW/AdYu+lHVdnzDfJhPa0auyTc1YAJ 4lRrWIFk4mAf5yFH/1H+JHgGzAHy+usn3IbbDOELMo/PCwf/NrhBCao7R5Si9P8d DCfuo/mApIdZabFoiHGL =e9YT -----END PGP SIGNATURE----- --qgNrgGfFsws9WDdn--