Skip to content

Instantly share code, notes, and snippets.

@monsha
Created April 6, 2018 14:51
Show Gist options
  • Save monsha/a703b010aa63e2046645becbed1991db to your computer and use it in GitHub Desktop.
Save monsha/a703b010aa63e2046645becbed1991db to your computer and use it in GitHub Desktop.
Terminate a sql query from psql
# run in your psql console
#
# test=# SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE query='SELECT "posts".* FROM "posts"';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment