How To See Currently Executing PostgreSQL Queries

IT Support Forum Forums Databases PostgreSQL Troubleshooting How To See Currently Executing PostgreSQL Queries

Viewing 0 reply threads
  • Author
    Posts
    • #1913
      Webmaster
      Keymaster

      To get a list of queries that are currently running in PostgreSQL, run the following SQL query against the database:

      SELECT *
      FROM pg_stat_activity
      WHERE application_name NOT LIKE ‘pgAdmin%’
      AND NOT query = ‘DISCARD ALL’
      AND NOT query = ‘unlisten *’;

      You can also use this to see how long the query has been running by pressing Shift + F7.

Viewing 0 reply threads
  • You must be logged in to reply to this topic.