Answers for "kill a pid in postgres"

SQL
3

postgres kill running query

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

--Terminate immediately
SELECT pg_terminate_backend(pid);
Posted by: Guest on April-09-2020
1

psql kill pid

select pg_terminate_backend(pid) 
from pg_stat_activity 
where pid = '18765';
Posted by: Guest on March-08-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language