Restore CurrentUserId only if 'prevUser' is valid when abort transaction - Mailing list pgsql-hackers

From Richard Guo
Subject Restore CurrentUserId only if 'prevUser' is valid when abort transaction
Date
Msg-id CAN_9JTxECSb=pEPcb0a8d+6J+bDcOZ4=DgRo_B7Y5gRHJUM=Rw@mail.gmail.com
Whole thread Raw
Responses Re: Restore CurrentUserId only if 'prevUser' is valid when aborttransaction  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi,

This is a follow-up to the issue described in thread

In short, during the first transaction starting phase within a backend, if
there is an 'ereport' after setting transaction state but before saving
CurrentUserId into 'prevUser' in TransactionStateData, 'prevUser' will remain
as InvalidOid. Then in AbortTransaction(), CurrentUserId is restored with
'prevUser'. As a result, CurrentUserId will be InvalidOid in the rest of the
session.

Attached is a patch that fixes this issue.

Thanks
Richard


Attachment

pgsql-hackers by date:

Previous
From: "Imai, Yoshikazu"
Date:
Subject: RE: Why we allow CHECK constraint contradiction?
Next
From: legrand legrand
Date:
Subject: Re: [Proposal] Add accumulated statistics for wait event