ankane / pghero

A performance dashboard for Postgres
MIT License
8.16k stars 452 forks source link

[Idea] Enable/Disable Option for "Kill" Button #498

Open doganilker opened 6 months ago

doganilker commented 6 months ago

Hello,

I've been using PgHero and I appreciate the work you've put into this tool.

In the "Ideas" issue (#425), I noticed an idea that suggests adding an option to disable killing queries and connections (kill branch).

Making the "Kill" button functionality optional could indeed prevent accidental terminations and potentially enhance the user experience of PgHero.

I'm aware that similar issues were raised in 2021. However, since this idea is listed in the "Ideas", it might be something you're considering.

Many thanks.

vineethvijay7 commented 1 month ago

would like this feature too

iul1an commented 1 month ago

This would be a great feature for me as well. Until then, I use a workaround.

I'm using PgHero with a non-superuser account and followed this guide. However, I changed the pghero.pg_terminate_backend(pid int) function so that it doesn't kill the queries:

CREATE OR REPLACE FUNCTION pghero.pg_terminate_backend(pid int) RETURNS boolean AS
$$
  SELECT true;
$$ LANGUAGE sql VOLATILE SECURITY DEFINER;

This adjustment allows me to "disable" the "kill" button without breaking the application or requiring code changes.