Re: pgsql: Allow GRANT on pg_log_backend_memory_contexts().

2021-10-28 Thread Alvaro Herrera
On 2021-Oct-27, Jeff Davis wrote: > Above the table of functions it already says: > > "Use of these functions is restricted to superusers by default but > access may be granted to others using GRANT, with noted exceptions." > > It looks like several people missed that, so perhaps we should get r

Re: pgsql: Allow GRANT on pg_log_backend_memory_contexts().

2021-10-27 Thread Michael Paquier
On Wed, Oct 27, 2021 at 08:12:23AM -0700, Jeff Davis wrote: > It looks like several people missed that, so perhaps we should get rid > of that statement at the top, and move it in to each function > description? Oops, you are right, sorry about the useless noise. With a table that includes all th

Re: pgsql: Allow GRANT on pg_log_backend_memory_contexts().

2021-10-27 Thread Jeff Davis
On Wed, 2021-10-27 at 13:15 +0900, Michael Paquier wrote: > I don't think that the documentation part of this commit is correct. > This sentence should have been changed to something like the > following: > "This function is restricted to superusers by default, but other > users > can be granted EX

Re: pgsql: Allow GRANT on pg_log_backend_memory_contexts().

2021-10-26 Thread Bharath Rupireddy
On Wed, Oct 27, 2021 at 10:33 AM Michael Paquier wrote: > > On Wed, Oct 27, 2021 at 10:27:18AM +0530, Bharath Rupireddy wrote: > > +1 and the above statement looks good. Apart from that I have one more > > suggestion that I earlier made: have the function produce the error > > when no permissions

Re: pgsql: Allow GRANT on pg_log_backend_memory_contexts().

2021-10-26 Thread Michael Paquier
On Wed, Oct 27, 2021 at 10:27:18AM +0530, Bharath Rupireddy wrote: > +1 and the above statement looks good. Apart from that I have one more > suggestion that I earlier made: have the function produce the error > when no permissions were granted (just to ensure we have the error > message covered) i

Re: pgsql: Allow GRANT on pg_log_backend_memory_contexts().

2021-10-26 Thread Bharath Rupireddy
On Wed, Oct 27, 2021 at 9:45 AM Michael Paquier wrote: > > On Tue, Oct 26, 2021 at 08:41:11PM +, Jeff Davis wrote: > > Allow GRANT on pg_log_backend_memory_contexts(). > > > > Remove superuser check, allowing any user granted permissions on > > pg_log_backend_memory_contexts() to log the memor

Re: pgsql: Allow GRANT on pg_log_backend_memory_contexts().

2021-10-26 Thread Michael Paquier
On Tue, Oct 26, 2021 at 08:41:11PM +, Jeff Davis wrote: > Allow GRANT on pg_log_backend_memory_contexts(). > > Remove superuser check, allowing any user granted permissions on > pg_log_backend_memory_contexts() to log the memory contexts of any > backend. > > Note that this could allow a priv

pgsql: Allow GRANT on pg_log_backend_memory_contexts().

2021-10-26 Thread Jeff Davis
Allow GRANT on pg_log_backend_memory_contexts(). Remove superuser check, allowing any user granted permissions on pg_log_backend_memory_contexts() to log the memory contexts of any backend. Note that this could allow a privileged non-superuser to log the memory contexts of a superuser backend, bu