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.



Reply via email to