pg_stat_activity doubts

From: Debraj Manna <subharaj(dot)manna(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: pg_stat_activity doubts
Date: 2018-03-22 12:45:38
Message-ID: CAF6DVKPf6-d3mn7t+N2bvHTB_zi2hWrDOL83FFj8xPrRWiXDqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi

Can someone resolve my below doubts about pg_stat_activity :-

1. Can someone let me know how pg_stat_activity is populated? If I am
executing a query like `Select * from pg_stat_activity` does it produce
the details from some snapshot maintained by postgres or it checks the
current connections open in postgres to provide the details?
2. Can some let me know what does the state IDLE denotes in the row of
pg_stat_activity? Is it like it checks all the open connections to
postgres and if the connection is not executing any query then IDLE denotes
the last query executed by the connection?
3. In the output of select * from pg_stat_activity I am seeing rows
with state
IDLE and the query_start_date more than 2 days old? What does this
signify ? Should I be worried about this?
4.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bear Giles 2018-03-22 13:19:55 Re: postgres encryption
Previous Message Gary Stainburn 2018-03-22 09:53:48 Re: postgres encryption