Re: bug reapper: Empty query_id in pg_stat_activity

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>
Cc: "duomi(dot)peng" <duomi(dot)peng(at)qq(dot)com>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: bug reapper: Empty query_id in pg_stat_activity
Date: 2025-08-28 12:42:32
Message-ID: CAKAnmmLYvGuDD1k1gqgSdYzhhZGdz32bS-mo8ZF40Fw7UxtG7w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Aug 28, 2025 at 8:25 AM Srinath Reddy Sadipiralla <
srinath2133(at)gmail(dot)com> wrote:

> The fix I tried is to retain the previous query_id (prev_st_query_id) and
> return it when st_query_id is still 0 but query_id computation is enabled,
> thoughts?
>

This just moves the race condition around a little - you can end up with a
query that does not agree with its query_id.

Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2025-08-29 11:39:42 BUG #19036: Failed prepared INSERT statement make another SELECT query generate wrong result
Previous Message Srinath Reddy Sadipiralla 2025-08-28 12:28:10 Re: bug reapper: Empty query_id in pg_stat_activity