Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQZYg-00BdOZ-16 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Dec 2025 23:13:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQZYe-00AQvL-04 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Dec 2025 23:13:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQZYd-00AQvC-2L for pgsql-hackers@lists.postgresql.org; Tue, 02 Dec 2025 23:13:20 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQZYb-002pMs-1d for pgsql-hackers@lists.postgresql.org; Tue, 02 Dec 2025 23:13:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 5B2NDGIK512381; Tue, 2 Dec 2025 18:13:16 -0500 From: Tom Lane To: Chao Li cc: Nathan Bossart , Rahila Syed , Robert Haas , PostgreSQL Hackers Subject: Re: pgindent versus struct members and typedefs In-reply-to: <5E70CB69-1E2D-471B-8CF8-83205E5E14CE@gmail.com> References: <347EA055-D626-414C-B10D-7E70041B9B55@gmail.com> <509793.1764715875@sss.pgh.pa.us> <5E70CB69-1E2D-471B-8CF8-83205E5E14CE@gmail.com> Comments: In-reply-to Chao Li message dated "Wed, 03 Dec 2025 07:06:45 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <512379.1764717196.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 02 Dec 2025 18:13:16 -0500 Message-ID: <512380.1764717196@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Chao Li writes: >> On Dec 3, 2025, at 06:51, Tom Lane wrote: >> In this case, I think pgindent is indirectly enforcing good style. >> I do not like omitting braces around anything that's more than one >> line; readers have to pay close attention to whether the code is >> doing what it was intended to. > For =E2=80=9Cone line=E2=80=9D, do you mean only a single line of statem= ent or one line statement plus one line comment? In my head, a comment and a statement are two lines, and so need wrapping braces as much as two statements would do. I realize that C compilers think differently, but for readability and modifiability reasons that's the approach I take. regards, tom lane