Custom Search

Friday, November 13, 2015

How to postgresql find and kill a hanging query

1)
Login as superuser
$ sudo -u postgres psql

2)
Find "procpid" of your problematic query by running
postgres=# select * from pg_stat_activity;

3)
Kill your problematic query
postgres=# select pg_terminate_backend(procpid);

No comments:

Post a Comment