Re: A little cosmetic to convert_VALUES_to_ANY() - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: A little cosmetic to convert_VALUES_to_ANY()
Date
Msg-id CAKFQuwbcqBMPG-O=9ni_J9KL63Jo-BvpX5hh2vY_DK7ORu68pA@mail.gmail.com
Whole thread Raw
In response to Re: A little cosmetic to convert_VALUES_to_ANY()  (Tender Wang <tndrwang@gmail.com>)
List pgsql-hackers
On Sun, Aug 3, 2025 at 9:40 PM Tender Wang <tndrwang@gmail.com> wrote:

Also, add a brace for better/more consistent style in the attached patch.

Should try and avoid oh-by-the-way fixes like this in behavior patches.

This specific one also doesn't seem warranted. Or, at least, the original style is indeed de facto acceptable; if-blocks containing a single executing statement do not get braces but rely on indentation alone.  I don't think that every other if-block in the region being multi-statement supports an exception.

Add brace for better/more consistent style.
 

OK...I only agree with one of those changes and the overall patch is basically a code style patch and a single function affected - neither of which applied here.  I'd probably have done the else-if block too; but there is nothing wrong or definitely better about the initial guard being braced and I'd argue the brace-less version is subjectively superior.  Not enough to go back and change again but still the original choice was better IMO.

David J.

pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX
Next
From: Yugo Nagata
Date:
Subject: Fix a typo of mod_since_analyze in do_analyze_rel