Re: Honor inherited ownership when finishing prepared transactions

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Honor inherited ownership when finishing prepared transactions
Date: 2026-11-09 10:30:09
Message-ID: B11FDEC8-4D9B-48C9-BD53-62CB1685D3B5@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Kirill,

On November 2, 2026, Kirill Reshke wrote:
> So, can we use same in 2pc (prepared) tx?

I agree that prepared transactions should follow the same inherited
ownership rules as other objects. has_privs_of_role() seems the right
check, including INHERIT TRUE, SET FALSE.

In the roles discussion you linked, Tom explicitly suggested retaining
this check. I think it is worth revisiting that decision.

One implementation detail. LockGXact() currently checks ownership while
holding TwoPhaseStateLock. Membership expansion can read pg_auth_members
and acquire a relation lock on a cache miss. Could we reserve the GXACT,
release the LWLock, then check permission, using the existing abort
cleanup if permission is denied?

Could you post the patch?

Thank you!

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-11-09 10:40:45 Re: Add a hint to the "WAL summaries are required" errors
Previous Message Xuneng Zhou 2026-11-09 10:00:06 Re: BGWORKER_INTERRUPTIBLE workers are never restarted after DROP/ALTER/CREATE DATABASE