pg_terminate_backend and pg_cancel_backend by not administrator user

From: Torello Querci <tquerci(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_terminate_backend and pg_cancel_backend by not administrator user
Date: 2011-02-14 12:10:06
Message-ID: AANLkTin1qJGVVUmnpaWBpRk9=VPvgkhEE7Mp=4v4qSF=@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

this is the first time that I post here, so if I wrong please don't kill me ...
I see that pg_terminate_backend and pg_cancel_backend can be execute
only by admin users.
This approach seems to be too restrictive in a lots of real situation.

In dept, I have a situation where it is created one database machine
for all the postgresql database.
This database machine is managed by IT staff that have created two
user for each application.
One user is the owner db user that create, drop, grant on this db,
while the other user is the application db.

In this situation I (the developer) not able to disconnect any client
and stop any high weight queries.
Unfortunately the application run on application server that is
manager, again, by IT staff and I not have the right to stop it.

I suppose that give the right to the owner db user to terminate or
cancel other session connected to the database which it is owner is a
good thing.
I not see any security problem because this user can cancel or
terminate only the session related with the own database,
but if you think that this is a problem, a configuration parameter can be used.

Of course I can create a function with admin right that do the same
thing but the IT staff need to install, configure, and give the right
grant.
So, I suppose, that this can to be only a workaround, not the solution.

Sorry for my English.

I attach a path for this

Best Regards, Torello

Attachment Content-Type Size
pg_signal_backend.patch text/x-patch 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2011-02-14 12:24:18 Re: Debian readline/libedit breakage
Previous Message Dimitri Fontaine 2011-02-14 11:48:26 Re: [HACKERS] "Extension" versus "module"