Skip to content

Instantly share code, notes, and snippets.

@ismailmechbal
Created November 17, 2016 22:32
Show Gist options
  • Save ismailmechbal/a92f00f745f626512dfa8ff90a6852ea to your computer and use it in GitHub Desktop.
Save ismailmechbal/a92f00f745f626512dfa8ff90a6852ea to your computer and use it in GitHub Desktop.
# Older versions of pg uses procpid whereas newer uses pid.
SELECT pid, pg_terminate_backend(pid) as terminated FROM pg_stat_activity WHERE pid <> pg_backend_pid();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment