Hi all.
There is a bug in PgAdmin, if I use an option "set role" in the
connection dialog, I will not be able to cancel query anymore.
How to recreate. Config connection to a server to use "set role": the
dialog "properties" of a server, tab "connection", field "Role" assign
to DBO, without superuser privilege.
Run query, for instance "select pg_sleep(10000)" and try to finish it.
You will get
ERROR: permission denied to cancel query
DETAIL: Only roles with privileges of the role whose query is being
canceled or with privileges of the "pg_signal_backend" role may cancel
this query.
STATEMENT: SELECT pg_cancel_backend(497843);
First bug in the issue tracker is:
https://github.com/pgadmin-org/pgadmin4/issues/7442
The answer to assign user to the role pg_signal_backend is wrong and
will rise even security issue, the user will be able to terminate not
only his query, but everyone.
I reopened this bugreport for this reason.
https://github.com/pgadmin-org/pgadmin4/issues/7821
The answer was just lie:
The connection made using the details from server dialog is used
everywhere. pgAdmin cannot create a connection separately without the
role specified and execute pg_cancel_backend.
This is not a bug.
This behaviour is same as psql.
End cite.
The lie because a psql and DBeaver worked perfectly in this situation.
Everyone can set role in DBeaver connection dialog or in the psql "set
role dbo" after connection, run query and cancel query. This doesn't
work only in the PgAdmin and only due to reason, because developers
simply close bugs instead on fixing it.
If your way do nothing with buggy behavior of "set role", then just
remove it from the connection dialog.
--
Olleg