Difference between revisions of "Pg stat activity"

From wikieduonline
Jump to navigation Jump to search
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{lowercase}}
 +
select count(*) from [[pg_stat]]_activity where query like '[[autovacuum]]:%';
 +
count
 +
-------
 +
      0
 +
(1 row)
  
*<code>select count(*) from [[pg_stat]]_activity where query like '[[autovacuum]]:%';</code>
+
{{pg_stat_activity}}
  
 +
 +
SELECT [[pg_terminate_backend]](__pid__) from pg_stat_activity;
  
 
== Related terms ==
 
== Related terms ==
 +
* <code>select [[pg_terminate_backend]](procpid) from pg_stat_activity where datname = 'your-db';</code>
 
* <code>[[DataFileRead]]</code>
 
* <code>[[DataFileRead]]</code>
 
* [[PostgreSQL statistics collector]]
 
* [[PostgreSQL statistics collector]]
 
* <code>[[select count]]</code>
 
* <code>[[select count]]</code>
 +
* <code>[[pg_cancel_backend]]</code>
  
 
== See also ==
 
== See also ==
 +
* {{pg_stat}}
 +
* {{VACUUM}}
 
* {{PostgreSQL}}
 
* {{PostgreSQL}}
  
 
[[Category:PosgreSQL]]
 
[[Category:PosgreSQL]]

Latest revision as of 10:22, 5 May 2023

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 pg_terminate_backend(__pid__) from pg_stat_activity;

Related terms[edit]

See also[edit]

Advertising: