Created
July 23, 2022 00:38
-
-
Save marcomalva/609e5c631ee4cadf0ac5fdfa006e4b4e to your computer and use it in GitHub Desktop.
[psql-list-session-connection] List sessions / active connections in PostgreSQL database #psql
This file contains hidden or 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
| select pid as process_id, | |
| usename as user_name, | |
| datname as database_name, | |
| client_addr as client_address, | |
| application_name, | |
| backend_start, | |
| state, | |
| state_change | |
| from pg_stat_activity | |
| where datname like '%' | |
| order by datname, application_name, process_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment