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 1mk8jz-0007oK-Qm for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Nov 2021 17:47:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mk8jy-0001Il-QD for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Nov 2021 17:47:30 +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 1mk8jy-0001Ic-Gg for pgsql-hackers@lists.postgresql.org; Mon, 08 Nov 2021 17:47:30 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mk8jw-0001HB-Do for pgsql-hackers@postgresql.org; Mon, 08 Nov 2021 17:47:29 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 967345F7A2; Mon, 8 Nov 2021 12:47:23 -0500 (EST) Date: Mon, 8 Nov 2021 12:47:23 -0500 From: Stephen Frost To: Andres Freund Cc: Robert Haas , Jeff Davis , "Bossart, Nathan" , Alvaro Herrera , Bharath Rupireddy , PostgreSQL-development Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT. Message-ID: <20211108174723.GI20998@tamriel.snowman.net> References: <202110310026.zmhkxct6ka6c@alvherre.pgsql> <6498F6FC-714B-4AC2-B0E1-9A5321654277@amazon.com> <20211101165025.GS20998@tamriel.snowman.net> <5e7a618de1b49ba1ceede54ee1b1d073bd57f1f4.camel@j-davis.com> <20211104224204.ee5673h3qlzblh7e@alap3.anarazel.de> <20211107184649.mpncdezkzfq2v4pb@alap3.anarazel.de> <20211108172318.GF20998@tamriel.snowman.net> <20211108173325.6ury6xflvxq7yqbn@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="b4TJccIV73PFtYC8" Content-Disposition: inline In-Reply-To: <20211108173325.6ury6xflvxq7yqbn@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 --b4TJccIV73PFtYC8 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-08 12:23:18 -0500, Stephen Frost wrote: > > though I continue to feel like the function based approach is better. >=20 > I think it's a somewhat ugly hack. I suppose we'll just have to disagree on that. :) I don't feel as strongly as others apparently do on this point though, and I'd rather have non-superusers able to run CHECKPOINT *somehow* than not, so if the others feel like a predefined role is a better approach then I'm alright with that. Seems a bit overkill to me but it's also not like it's actually all that much code or work to do. > > then we must use such an approach no matter how we allow non-superusers= to > > run the command because any approach to that necessarily involves some > > amount of catalog access. >=20 > As long as there's no additional catalog access when the user is known to= be a > superuser, then I think it's fine. There's a difference between doing one > pg_authid read for superuser - with a fallback to automatically assuming a > user if one couldn't be found - and doing a full pg_proc read with several > subsidiary pg_type reads etc. Yes, the approach I'm suggesting would make the superuser-run CHECKPOINT be exactly the same as it is today, while a non-superuser trying to run a CHECKPOINT would end up doing additional catalog accesses. Thanks, Stephen --b4TJccIV73PFtYC8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJhiWKrAAoJEO1sijiDR2RVZpQP/0ygvPxXqPcayv0SkbSsr9Tb VJLh1f3p4NyqR5J6Su023giVWyl5JLzX0tXMwlzSmtgzWcAnE+9sR9kgfpNgE128 8vnzOQ7Z6YrCW1iyx/tx2n8YSxMxxw/UEgbZZBu0dq1i6HXSVzdkaFvQfFi+Vuv2 qso9OFgBkJechHjSYks83Bw2tPXt+0v/VQFH29oqJ71F2gM7T2mudfKFhSwd7/42 1DaAEx2CwRnuok5Eo4eajrY89pQpRTe+BImQf1SpFE++EAYQjKty9CzLZ/YSq/Vg uKlMtsgxRh49JmKd0+gQsH7h/RlUuLSFaWw5LwLSQlwCSre3c+60VY2sub3MD8ab ZPZtZQeY8UwNvd21viy3rf4JYbLa6mETCJlsxdaVvc3SWiTZip4KtQC6obEwddTC tEOx9XGGoLzfJANd6T96NwXzdjpkx5hIeHPzgH8ezvfQl97/ZCgMEfITkQ9B2JVz eMIdzMXc+w6CTrANPqutzD91UthE3gwPIknbrf1cQ6ZDQ1JgUzGVsUvHFM4cKlQR jAeKFIamG4EF0D0RVRX4lzEjMMUyRN5WV8LjrFxAgeaGtcjbus2cZXIoByqonefV i/iYkvL0f1OQZ/NDkSqQE7L50FqbC0hFG+rXVxZS/S5U2fH48JV43wTkN4DQ+bP9 811CGLqYT7nHM6RUzeH6 =6e3n -----END PGP SIGNATURE----- --b4TJccIV73PFtYC8--