postgres kill running query
snippet in sql

postgres kill running query

user5278

--Stop the query normally
SELECT pg_cancel_backend(pid);

--Terminate immediately
SELECT pg_terminate_backend(pid);