From: Mario Splivalo <mario.splivalo@megafon.hr>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Giving postgres roles 'sudo'-like access
Date: Mon, 19 Dec 2011 19:04:13 +0100
Message-ID: <4EEF7C9D.60006@megafon.hr> (raw)
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(<pid>)"', but before that
run checks that <pid> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: mario.splivalo@megafon.hr
Subject: Re: Giving postgres roles 'sudo'-like access
In-Reply-To: <4EEF7C9D.60006@megafon.hr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox