Skip to content

Instantly share code, notes, and snippets.

@rubenarakelyan
Created December 21, 2021 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubenarakelyan/3fd43cb74f59063d58ee7876566b48b7 to your computer and use it in GitHub Desktop.
Save rubenarakelyan/3fd43cb74f59063d58ee7876566b48b7 to your computer and use it in GitHub Desktop.
List of useful SQL commands for PostgreSQL

Disconnect all connected clients

SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE datname = 'mydb';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment