Re: empty,query_id, pg_stat_activity
Greg Sabino Mullane <htamfids@gmail.com>
From: Greg Sabino Mullane <htamfids@gmail.com>
To: zhouenbing <zhouenbing@sunwoda-evb.com>
Cc: Michael Paquier <michael@paquier.xyz>, pgsql-bugs@lists.postgresql.org
Date: 2025-09-04T12:56:05Z
Lists: 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 -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support