Skip to content

Instantly share code, notes, and snippets.

@grantpullen
Created August 1, 2018 10:15
Show Gist options
  • Save grantpullen/6f1f703a0037ad9e7481ab424c3c8647 to your computer and use it in GitHub Desktop.
Save grantpullen/6f1f703a0037ad9e7481ab424c3c8647 to your computer and use it in GitHub Desktop.
Postgres runtime stats, active connections
-- numbackends
SELECT datname, numbackends FROM pg_stat_database where numbackends > 0;
SELECT * FROM pg_stat_activity WHERE backend_type = 'client backend';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment