Re: pg_prepared_xacts returns transactions that are foreign to the caller

From: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
To: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_prepared_xacts returns transactions that are foreign to the caller
Date: 2024-11-20 09:07:48
Message-ID: 4C0DB4B1-489C-4804-83CA-B8EAB2247107@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 20 Nov 2024, at 12:48, Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com> wrote:
>
> "select * from pg_prepared_xacts" might produce transactions created by a different user, so the caller won't be able to issue "commit prepared".
>
> I think there should be a view that returns only the transactions that the caller can commit or rollback.
> Is it something that can be implemented at the backend?

Like "select * from pg_prepared_xacts where pg_has_role(current_user, owner, 'member');"?

Best regards, Andrey Borodin.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rahila Syed 2024-11-20 09:09:15 Re: Enhancing Memory Context Statistics Reporting
Previous Message Peter Eisentraut 2024-11-20 09:05:32 Re: RFC: Additional Directory for Extensions