Last active
March 14, 2018 12:06
-
-
Save atiq1589/12fb5968a224099dadbeae335f3fbf5c to your computer and use it in GitHub Desktop.
How to stop/kill a query in postgresql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- To check the active activity | |
select * from pg_stat_activity where state = 'active'; | |
-- To cancle an activity | |
select pg_cancel_backend(<pid of the process>) | |
-- To Terminate an activity | |
select pg_terminate_backend(<pid of the process>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment