Monday, July 17, 2017

Listing Queries Runing in PostgreSQL DBMS

To see which queries are being executed by a user in PostgreSQL DBMS, one may use the following query,


SELECT 
       usename, application_name, state, query 
FROM
       pg_stat_activity 
WHERE 
       usename='my_user_name';
where my_user_name should be actual username being queried about.

1 comment:

  1. Thanks Gray! I often end up on your web page when i am having technical difficulties and want easy to have instructions! you guys never disappoint

    ReplyDelete