From 0495aaad8b337642830a4d4e82f8b8c02b27b1be Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sun, 15 Jan 2012 15:34:40 +0100 Subject: Allow a user to kill his own queries using pg_cancel_backend() Allows a user to use pg_cancel_queries() to cancel queries in other backends if they are running under the same role. pg_terminate_backend() still requires superuser permissoins. Short patch, many authors working on the bikeshed: Magnus Hagander, Josh Kupershmidt, Edward Muller, Greg Smith. --- doc/src/sgml/func.sgml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 2e06346584c..7d7aba7aeef 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -14262,8 +14262,8 @@ SELECT set_config('log_statement_stats', 'off', false); The functions shown in send control signals to - other server processes. Use of these functions is restricted - to superusers. + other server processes. Use of these functions is usually restricted + to superusers, with noted exceptions. @@ -14280,7 +14280,10 @@ SELECT set_config('log_statement_stats', 'off', false); pg_cancel_backend(pid int)boolean - Cancel a backend's current query + 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. + @@ -14322,6 +14325,10 @@ SELECT set_config('log_statement_stats', 'off', false); postgres processes on the server (using ps on Unix or the Task Manager on Windows). + For the less restrictive pg_cancel_backend, the role of an + active backend can be found from + the usename column of the + pg_stat_activity view. -- cgit v1.2.3