Re: Simplify the way of appending comma to stringInfo

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Simplify the way of appending comma to stringInfo
Date: 2025-12-08 15:09:15
Message-ID: 3000581.1765206555@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <hlinnaka(at)iki(dot)fi> writes:
> On 08/12/2025 10:37, Chao Li wrote:
>> The old patterns are used in a lot of places, and there are some usages
>> of the new pattern as well. Instead of creating a big cleanup patch, I
>> just applied the new pattern to a single file for now to see if the
>> hacker group likes this change.

> It's a matter of taste, but I personally prefer the "old" pattern with
> an explicit if() statement more. And I don't think it's worth the code
> churn to change existing code either way.

Yeah, the "code churn" objection is a big one in my mind. Any
cosmetic change like this creates merge hazards for back-patching
bug fixes in nearby code. Of course any one such change has only a
very low risk of causing back-patching pain, but if you are proposing
to do it in dozens or hundreds of places then the risk becomes much
greater. Cosmetic changes also make it more painful to identify the
origin of code segments via "git blame". I don't think this is such a
huge improvement as to justify those costs.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Ashutosh Bapat 2025-12-08 14:58:59 Re: SQL Property Graph Queries (SQL/PGQ)