Removing redundant check for transaction in progress in check_safe_enum_use

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Removing redundant check for transaction in progress in check_safe_enum_use
Date: 2021-07-04 01:45:12
Message-ID: CALNJ-vS5iANLVWb62=Com4UUU+7aZOUd7MKgR-jQPDRocjsVJA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
txn-in-progress-enum.patch application/octet-stream 502 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2021-07-04 01:53:48 Re: pgbench using COPY FREEZE
Previous Message Tom Lane 2021-07-03 22:59:49 Re: Reducing the cycle time for CLOBBER_CACHE_ALWAYS buildfarm members