From bf038899965263dbc4aef2b43c8fdfe6f49b788f Mon Sep 17 00:00:00 2001 From: Stephen Frost Date: Thu, 19 Mar 2015 15:02:33 -0400 Subject: GetUserId() changes to has_privs_of_role() The pg_stat and pg_signal-related functions have been using GetUserId() instead of has_privs_of_role() for checking if the current user should be able to see details in pg_stat_activity or signal other processes, requiring a user to do 'SET ROLE' for inheirited roles for a permissions check, unlike other permissions checks. This patch changes that behavior to, instead, act like most other permission checks and use has_privs_of_role(), removing the 'SET ROLE' need. Documentation and error messages updated accordingly. Per discussion with Alvaro, Peter, Adam (though not using Adam's patch), and Robert. Reviewed by Jeevan Chalke. --- doc/src/sgml/func.sgml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 5843eaa9ffe..aa19e104d92 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -16328,9 +16328,9 @@ SELECT set_config('log_statement_stats', 'off', false); pg_cancel_backend(pid int) boolean - Cancel a backend's current query. You can execute this against - another backend that has exactly the same role as the user calling the - function. In all other cases, you must be a superuser. + Cancel a backend's current query. This is also allowed if the + calling role is a member of the role whose backend is being cancelled, + however only superusers can cancel superuser backends. @@ -16352,10 +16352,9 @@ SELECT set_config('log_statement_stats', 'off', false); pg_terminate_backend(pid int) boolean - Terminate a backend. You can execute this against - another backend that has exactly the same role as the user - calling the function. In all other cases, you must be a - superuser. + Terminate a backend. This is also allowed if the calling role + is a member of the role whose backend is being terminated, however only + superusers can terminate superuser backends. -- cgit v1.2.3