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 1mhbKW-0007bj-51 for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Nov 2021 17:42:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mhbKU-0000AJ-DT for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Nov 2021 17:42: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 1mhbKU-00009Y-4V for pgsql-hackers@lists.postgresql.org; Mon, 01 Nov 2021 17:42:42 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mhbKP-0004eP-Dw for pgsql-hackers@postgresql.org; Mon, 01 Nov 2021 17:42:41 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 1A1195F799; Mon, 1 Nov 2021 13:42:36 -0400 (EDT) Date: Mon, 1 Nov 2021 13:42:35 -0400 From: Stephen Frost To: "Bossart, Nathan" Cc: Alvaro Herrera , Jeff Davis , Bharath Rupireddy , PostgreSQL-development Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT. Message-ID: <20211101174235.GU20998@tamriel.snowman.net> References: <2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com> <202110310026.zmhkxct6ka6c@alvherre.pgsql> <6498F6FC-714B-4AC2-B0E1-9A5321654277@amazon.com> <20211101165025.GS20998@tamriel.snowman.net> <8B7DFC0A-9CF9-4620-9FDD-D1A4C8269B68@amazon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ZkPsHaVllGm+sYrn" Content-Disposition: inline In-Reply-To: <8B7DFC0A-9CF9-4620-9FDD-D1A4C8269B68@amazon.com> 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 --ZkPsHaVllGm+sYrn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Bossart, Nathan (bossartn@amazon.com) wrote: > On 11/1/21, 9:51 AM, "Stephen Frost" wrote: > > All that said, I wonder if we can have our cake and eat it too. I > > haven't looked into this at all yet and perhaps it's foolish on its > > face, but, could we make CHECKPOINT; basically turn around and just run > > select pg_checkpoint(); with the regular privilege checking happening? > > Then we'd keep the existing syntax working, but if the user is allowed > > to run the command would depend on if they've been GRANT'd EXECUTE > > rights on the function or not. >=20 > I'd be worried about the behavior of CHECKPOINT changing because > someone messed with the function. Folks playing around in the catalog can break lots of things, I don't really see this as an argument against the idea. I do wonder if we should put a bit more effort into preventing people =66rom messing with functions and such in pg_catalog. Being able to do something like: create or replace function xpath ( text, xml ) returns xml[] as $$ begin return 'xml'; end; $$ language plpgsql; (or with much worse functions..) strikes me as just a bit too easy to mistakenly cause problems as a superuser. Still, that's really an independent issue from this discussion. It's not like someone breaking CHECKPOINT; would actually impact normal checkpoints anyway. Thanks, Stephen --ZkPsHaVllGm+sYrn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJhgCcLAAoJEO1sijiDR2RVTmcP/3oSFDIzUSqUpTWEOtcRIIKM LI6sUE+XB5B1Y30Rq5kAKPBq4bt5gEDu6jG/OAol0Qt7KYo3ctJcQzopfHbvCpyk Nc2N7E0ybVNXGjprhN4MnVoDJGNl/ue+ynu1f5dOnMZqTtl6zwXZ0ESEM6naZMik dVjOzHNlSlToNJ07hnt1TxuLeYICb9S8SJ/7ybkmuVYk337kwZaNMC7aH00k/S77 GO7qC/Z45nYhyPXdJAYxMC9qjTUZLVAHoHEms/nJXqSdjaxkH2HJ8C2g1bm7BlGD JBSzj60hQnohW/f64r+uXqI1Iy3VSp4sGa6MMev7iIYs+bRC6ZgzMJv6ac+EAcex MGVvcwG6uXRmJl+XDoPj0eAhgXX4nYC1E5RUiUCYcAVHd9NL7dHrKGpLCFykg9mo 0TyTdH1pA2yjXjj7NyGCHnwUybHBvTaGd6vThNvtYYk8cLvUpGgh2iEytmWif81G H9nX1E5t4md2KJk05XDmsYTX5LeEQFae2UqXcULSwyJgNHor3FRZBQ0A5X/zYYEK EK/1GPLViZV+wRre6zH86gUDGuRCj1c7aR8/FukASEtc/blVVz/O07HYOHqajEgV TYjuETS3QwoUxViep7+Vp5QYb4Z985v8kvfZPX1aNcOqSe7L4Ggh3ODDePw+TSqT DWW1Drde4WdnU0LF7o8h =v2uQ -----END PGP SIGNATURE----- --ZkPsHaVllGm+sYrn--