Removing redundant check for transaction in progress in check_safe_enum_use - Mailing list pgsql-hackers

From Zhihong Yu
Subject Removing redundant check for transaction in progress in check_safe_enum_use
Date
Msg-id CALNJ-vS5iANLVWb62=Com4UUU+7aZOUd7MKgR-jQPDRocjsVJA@mail.gmail.com
Whole thread Raw
Responses Re: Removing redundant check for transaction in progress in check_safe_enum_use
List pgsql-hackers
Hi,
I was looking at :
Relax transactional restrictions on ALTER TYPE ... ADD VALUE (redux).

In check_safe_enum_use():

+   if (!TransactionIdIsInProgress(xmin) &&
+       TransactionIdDidCommit(xmin))
+       return;

Since the condition would be true only when TransactionIdDidCommit() returns true, I think the call to TransactionIdIsInProgress is not needed.
If transaction for xmin is committed, the transaction cannot be in progress at the same time.

Please see the simple patch for removing the redundant check.

Thanks

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reducing the cycle time for CLOBBER_CACHE_ALWAYS buildfarm members
Next
From: Tatsuo Ishii
Date:
Subject: Re: pgbench using COPY FREEZE