Re: empty,query_id, pg_stat_activity - Mailing list pgsql-bugs

From Greg Sabino Mullane
Subject Re: empty,query_id, pg_stat_activity
Date
Msg-id CAKAnmmJH=0jdNB+ujGJS1w=ZLFCtw1DEZ49uQ1HWd1m_C=NYOQ@mail.gmail.com
Whole thread Raw
In response to 答复: empty,query_id, pg_stat_activity  ("zhouenbing" <zhouenbing@sunwoda-evb.com>)
List pgsql-bugs
On Wed, Sep 3, 2025 at 11:32 PM zhouenbing <zhouenbing@sunwoda-evb.com> wrote:
pg_active_session_history as well. If Mr. Greg said that empty query_ids
indicate that the session SQL has not been executed, then I will exclude the
sessions with empty query_ids. But I think that if the SQL has not been
executed, the session status should be 'inactive' instead.

I understand your point, but "active" for pg_stat_activity means it is alive and doing something - just not what you are expecting in this case. We are not going to add a new status, or change it to inactive. You can think of the status you want (actively executing a query) as being indicated by the combination of state=active and queryid not null.

Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

pgsql-bugs by date:

Previous
From: Yushu Chen
Date:
Subject: Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own
Next
From: Tom Lane
Date:
Subject: Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own