Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 2101B16B0CAD for ; Mon, 19 Dec 2011 14:04:00 -0400 (AST) Received: from out2.mail.amis.hr ([188.129.0.5]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RchZ8-0005Xd-0J for pgsql-admin@postgresql.org; Mon, 19 Dec 2011 18:03:59 +0000 Received: from out.fsec.sm.srv.amis.hr (out.fsec.sm.srv.amis.hr [192.168.106.22]) by out2.mail.amis.hr (Postfix) with ESMTP id 092141FA3D for ; Mon, 19 Dec 2011 19:03:44 +0100 (CET) Received: from pps.filterd (out [127.0.0.1]) by out.fsec.sm.srv.amis.hr (8.14.3/8.14.3) with SMTP id pBJHwfjK024534 for ; Mon, 19 Dec 2011 19:03:43 +0100 Received: from smtp.amis.hr (smtp.sm.srv.amis.hr [192.168.106.39]) by out.fsec.sm.srv.amis.hr with ESMTP id 11t5hag4nr-1 for ; Mon, 19 Dec 2011 19:03:43 +0100 A-Original-Client-UID: 188.129.66.66 splivalo Received: from [192.168.10.1] (cpe-188-129-66-66.dynamic.amis.hr [188.129.66.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: splivalo) by smtp.amis.hr (Postfix) with ESMTPSA id 7599B270 for ; Mon, 19 Dec 2011 19:03:43 +0100 (CET) Message-ID: <4EEF7C9D.60006@megafon.hr> Date: Mon, 19 Dec 2011 19:04:13 +0100 From: Mario Splivalo User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: Giving postgres roles 'sudo'-like access Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110, 1.0.211, 0.0.0000 definitions=2011-12-19_05:2011-12-19, 2011-12-19, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1112190179 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201112/96 X-Sequence-Number: 38854 I need to have postgres role to be able to cancel queries run by that same role. I know that I can kill the client connection that started the query, but I also need to have that role connect to postgres and kill some of it's running queries. It's on postgres 9.1.1, running on Debian Squeeze. One idea that comes to mind is to have a special user account on the box which would have sudo privileges to the script which will issue 'sh postgres -c 'psql -c "select pg_cancel_backend()"', but before that run checks that is actually owned by correct role, etc, etc. But, all that seems very fishy. Has anyone had similar requests, and maybe solved them somehow? Mario