Re: BUG #16961: Could not access status of transaction

From: Daniil Davydov <3danissimo(at)gmail(dot)com>
To: Alexandra Wang <alexandra(dot)wang(dot)oss(at)gmail(dot)com>
Cc: noah(at)leadboat(dot)com, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stepan Yankevych <Stepan_Yankevych(at)epam(dot)com>, Stepan Yankevych <stepya(at)ukr(dot)net>, "sergii(dot)zhuravlev(at)smartnet(dot)ua" <sergii(dot)zhuravlev(at)smartnet(dot)ua>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Shruthi Gowda <gowdashru(at)gmail(dot)com>, Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
Subject: Re: BUG #16961: Could not access status of transaction
Date: 2025-08-06 03:30:39
Message-ID: CAJDiXghPYXA4n3==AA7gNjEew8M+y+VmZHybZd6bJ=m-eHPROw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Wed, Aug 6, 2025 at 6:30 AM Alexandra Wang
<alexandra(dot)wang(dot)oss(at)gmail(dot)com> wrote:
>
> Thank you for sharing your interim solution! Inspired by your solution, I found
> that there is an existing built-in function "pg_notification_queue_usage()"[1]
>
>> pg_notification_queue_usage () → double precision
>> Returns the fraction (0–1) of the asynchronous notification queue's maximum
>> size that is currently occupied by notifications that are waiting to be
>> processed. See LISTEN and NOTIFY for more information.
>
>
> This function calls asyncQueueAdvanceTail(). I think it's a similar workaround
> to your patch, but without code change.
>
> What do you think?
>

Yep, it can be used as a workaround. But obviously the user doesn't know when
this function should be called - it will become clear only when an error occurs,
that is, post factum. Thus, I think that it is better to add such a
functionality
to the autovacuum. This simple code will ensure that there are no
errors in most cases.

--
Best regards,
Daniil Davydov

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexandra Wang 2025-08-06 04:55:36 Re: BUG #16961: Could not access status of transaction
Previous Message Alexandra Wang 2025-08-05 23:30:12 Re: BUG #16961: Could not access status of transaction