Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity - Mailing list pgsql-bugs

From Fujii Masao
Subject Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity
Date
Msg-id 2153c106-8979-430d-ba86-34d35e565ab4@oss.nttdata.com
Whole thread Raw
In response to Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: [BUGS] BUG #10123: Weird entries in pg_stat_activity
List pgsql-bugs

On 2024/07/04 0:14, Fujii Masao wrote:
> I'm not sure if these are bugs. However, to prevent confusion from
> these odd pg_stat_activity entries, I suggest the following changes:
> 
>          1. Modify ProcessCatchupInterrupt() and RemoveTempRelationsCallback()
>              to reset stmtStartTimestamp (timestamp of the last query
> executed) to 0
>              before starting the transaction. This way, during the transaction,
>              records with state="idle" and xact_start=NULL would be observed.
> 
>          2. Update exec_describe_statement_message() and
> exec_describe_portal_message()
>              to change the state to "active," similar to exec_simple_query().
>              This would result in records with state="active" and
> xact_start="current timestamp"
>              during those operations.

Attached patch does these things. I will register it into the next CF.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Attachment

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18529: Can not install as Document
Next
From: Tender Wang
Date:
Subject: Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert