Re: Remove some unnecessary if-condition

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Remove some unnecessary if-condition
Дата
Msg-id 20201014072256.GB12403@paquier.xyz
обсуждение исходный текст
Ответ на RE: Remove some unnecessary if-condition  ("Hou, Zhijie" <houzj.fnst@cn.fujitsu.com>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Shinya Okano
Дата:
Сообщение: Re: Add a description to the documentation that toast_tuple_target affects "Main"
Следующее
От: Luc Vlaming
Дата:
Сообщение: Re: allow partial union-all and improve parallel subquery costing