Re: Remove some unnecessary if-condition

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove some unnecessary if-condition
Date: 2020-10-14 07:22:56
Message-ID: 20201014072256.GB12403@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 12, 2020 at 11:42:31AM +0000, Hou, Zhijie wrote:
> Thank you for reviewing! added it to commitfest
> https://commitfest.postgresql.org/30/2760/

- if (!bootstrap)
- {
- pgstat_bestart();
- CommitTransactionCommand();
- }
+ pgstat_bestart();
+ CommitTransactionCommand();
FWIW, I prefer the original style here. The if/elif dance is quite
long here so it can be easy to miss by reading the code that no
transaction commit should happen in bootstrap mode as this is
conditioned only by the top of the if logic.

I would also keep the code in reorderbuffer.c in its original shape,
because it does not actually hurt and changing it could introduce some
back-patching hazard, even if that be a conflict easy to fix.

There may be a point for the bit in informix.c, but similarly when you
think about back-patching I'd just keep it as it is.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Luc Vlaming 2020-10-14 07:38:08 Re: allow partial union-all and improve parallel subquery costing
Previous Message Shinya Okano 2020-10-14 07:21:37 Re: Add a description to the documentation that toast_tuple_target affects "Main"