pg_terminate_backend and pg_cancel_backend by not administrator user - Mailing list pgsql-hackers

From Torello Querci
Subject pg_terminate_backend and pg_cancel_backend by not administrator user
Date
Msg-id AANLkTin1qJGVVUmnpaWBpRk9=VPvgkhEE7Mp=4v4qSF=@mail.gmail.com
Whole thread Raw
Responses Re: pg_terminate_backend and pg_cancel_backend by not administrator user  (Anssi Kääriäinen <anssi.kaariainen@thl.fi>)
Re: pg_terminate_backend and pg_cancel_backend by not administrator user  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List 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

pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: "Extension" versus "module"
Next
From: Markus Wanner
Date:
Subject: Re: Debian readline/libedit breakage