Re: A little cosmetic to convert_VALUES_to_ANY()

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tender Wang <tndrwang(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: A little cosmetic to convert_VALUES_to_ANY()
Date: 2025-08-04 05:00:13
Message-ID: CAKFQuwbcqBMPG-O=9ni_J9KL63Jo-BvpX5hh2vY_DK7ORu68pA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Aug 3, 2025 at 9:40 PM Tender Wang <tndrwang(at)gmail(dot)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.
>>
>
> About this, you can check this commit
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=aadf7db66ef5a8a723eb3362e2c8b460738f1107
> .
> 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2025-08-04 05:01:20 Fix a typo of mod_since_analyze in do_analyze_rel
Previous Message Julien Rouhaud 2025-08-04 04:52:20 Re: [PATCH] Proposal to Enable/Disable Index using ALTER INDEX