Answers for "postgres show activity"

SQL
0

check connections to database postgres

SELECT * FROM pg_stat_activity WHERE datname='db_name';
Posted by: Guest on February-07-2020
0

see active transactions postgres

SELECT 
    pid
    ,datname
    ,usename
    ,application_name
    ,client_hostname
    ,client_port
    ,backend_start
    ,query_start
    ,query  
FROM pg_stat_activity
WHERE state <> 'idle'
AND pid<>pg_backend_pid();
Posted by: Guest on June-07-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language