How to find which queries are running PostgreSQL

In this article, we will see how to find which queries are running PostgreSQL. We can find the present running queries by querying against the system view pg_stat_activity.

To find, we must be logged in as a superuser or as the same database user we want to check.

What needs to be done to check this?

We have to set parameter track_activities=on in the postgresql.conf file or using the following SQL statement.

set track_activities=on

Continue reading How to find which queries are running PostgreSQL