Difference between revisions of "Template:Pg stat activity"
Jump to navigation
Jump to search
Line 3: | Line 3: | ||
SELECT * FROM pg_stat_activity WHERE datname = 'dbname' and state = 'active'; | SELECT * FROM pg_stat_activity WHERE datname = 'dbname' and state = 'active'; | ||
SELECT [[usename]], application_name, [[client_addr]], client_hostname, [[state]] FROM pg_stat_activity; | SELECT [[usename]], application_name, [[client_addr]], client_hostname, [[state]] FROM pg_stat_activity; | ||
+ | SELECT pg_terminate_backend(__pid__) from pg_stat_activity; |
Latest revision as of 10:22, 5 May 2023
SELECT * FROM pg_stat_activity; SELECT * FROM pg_stat_activity WHERE datname = 'dbname'; SELECT * FROM pg_stat_activity WHERE datname = 'dbname' and state = 'active'; SELECT usename, application_name, client_addr, client_hostname, state FROM pg_stat_activity; SELECT pg_terminate_backend(__pid__) from pg_stat_activity;
Advertising: