Created
August 29, 2019 13:24
-
-
Save smith3v/2467a02e0d03e3b91a4e11ed7969e315 to your computer and use it in GitHub Desktop.
Query to look the current activity in PG cluster
This file contains 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 (now() - query_start), datname, pid, usename, client_addr, client_port, state, CASE WHEN char_length(query) > 244 THEN substring(query, 1, 200) || ' .. ' || substring(query FROM '.{200}$') ELSE query END AS short_query from pg_stat_activity; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment