pg stat activity

From wikieduonline
Revision as of 13:15, 6 February 2023 by Brave (talk | contribs)
Jump to navigation Jump to search

select count(*) from pg_stat_activity where query like 'autovacuum:%';
count
-------
     0
(1 row)
 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;


 SELECT usename, client_addr, client_hostname FROM pg_stat_activity;


SELECT pg_terminate_backend(__pid__) from pg_stat_activity;

Related terms

 select pg_terminate_backend(procpid) from pg_stat_activity where datname = 'your-db';

See also

Advertising: