pg_stat_statements_reset() function execute permissions doc update

Started by Haribabu Kommiover 7 years ago1 messages
#1Haribabu Kommi
kommi.haribabu@gmail.com
1 attachment(s)

The pg_stat_statements_reset() function can be executed by super and
members of the role pg_read_all_stats, but document doesn't say that.
This is found during the code review of another patch in [1]/messages/by-id/3368121530260059@web21g.yandex.ru.

Patch attached. This needs a backpatch till 10 where the default roles are
added.

[1]: /messages/by-id/3368121530260059@web21g.yandex.ru
/messages/by-id/3368121530260059@web21g.yandex.ru

Regards,
Haribabu Kommi
Fujitsu Australia

Attachments:

0001-pg_stat_statements_reset-function-execution-permissi.patchapplication/octet-stream; name=0001-pg_stat_statements_reset-function-execution-permissi.patchDownload
From 570dc5c7a2e59b856b3edec2a3ce327336dd2fe6 Mon Sep 17 00:00:00 2001
From: Hari Babu <kommi.haribabu@gmail.com>
Date: Mon, 2 Jul 2018 14:36:42 +1000
Subject: [PATCH] pg_stat_statements_reset() function execution permission doc
 update

This function can also execute by the members of the role pg_read_all_stats
along with superuser, but docs don't mention it.
---
 doc/src/sgml/pgstatstatements.sgml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml
index c0217ed485..ad6d2b9e7d 100644
--- a/doc/src/sgml/pgstatstatements.sgml
+++ b/doc/src/sgml/pgstatstatements.sgml
@@ -346,7 +346,9 @@
      <para>
       <function>pg_stat_statements_reset</function> discards all statistics
       gathered so far by <filename>pg_stat_statements</filename>.
-      By default, this function can only be executed by superusers.
+      By default, this function can only be executed by superusers and members
+      of the <literal>pg_read_all_stats</literal> role. Access may be granted
+      to others using <command>GRANT</command>.
      </para>
     </listitem>
    </varlistentry>
-- 
2.16.1.windows.4