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 1wKR6k-000ySr-14 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 May 2026 01:31:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wKR5j-00EW7F-1Z for pgsql-hackers@arkaria.postgresql.org; Wed, 06 May 2026 01:30:23 +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 1wKR5j-00EW75-0d for pgsql-hackers@lists.postgresql.org; Wed, 06 May 2026 01:30:23 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wKR5d-00000000Pdn-3HnP for pgsql-hackers@lists.postgresql.org; Wed, 06 May 2026 01:30:22 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-838d0b7c950so1316994b3a.3 for ; Tue, 05 May 2026 18:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778031017; x=1778635817; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=R2tFTP0bP2dUpHiRmdzN6DI+MtefsOlIj1i/Os8gPYw=; b=mFpxh0eKhD6uhKgcQQ3r2B+NH4H7voSmoY6d/o0ZerJLN9/Y84Bvu/m4LUDejAn95a 1LEONvDU3tPwv6FrbwFG1Hhv3pC5xc6jzwH1qoZh1jW+8gI9EWwDKOTpoUu8kY2iTjYh GcFnF8L8i+1ftgp6PdTT2PkVJSXHu7nDfcdpVdDXcZJT92gtTvRiKWwdBWAIDc/4SAsl ihrw/b4XtCUPXRLWp5vFTBZK6kmW2/m0O4p0w0gvX/lLQgrRn2rSOPHrKLY6meo8pXoN jYQnaJ0TXsQJHaWIhSgHKhP77f0nq3MJZVzowZz6q6usy3EAwqVkd45CnMKJU0bHRF8W A+Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778031017; x=1778635817; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=R2tFTP0bP2dUpHiRmdzN6DI+MtefsOlIj1i/Os8gPYw=; b=fJAQlXtCdq21on1m0mmXIvGjgWQBo5a04shvIg0fF4IzRqznSGrCqpuzko72ke+9kx 1evuprn0MqygzQTtJjJ2hFrUUb1zC834gLrhI12bEoAclSlFrj9x6almFRuhHCrRRFcP BYGNTZBSQVzGpzsTrDDt+RMjXcwjoyynzkr+GM4lcDKfrvPU8byEIeNkcivpas0jC/gD w+Ho14/YBBta2ce3n5Y4wAKtq3y/mtWgevS4u/4g4riytaNIQiPuFA35rStVKy+ULjb1 w4FXrsi2FKDHqheaQMDSkoBIUfGi1x4X2285NOaPlwT+cd2T0zHCxFNbwu9G5Nl7Svz8 68+Q== X-Forwarded-Encrypted: i=1; AFNElJ90DMQN1jSs5RDAoGHnCfS7MHx/RccCfPvkY47xH1/L3stEAGBt3Mh/Ozzkpez0GdnRGac8SvcNKoF2XdLH@lists.postgresql.org X-Gm-Message-State: AOJu0YwJwwBQyNB2UYNRKuNUkoiscjZsqOod0yRMrTuoFiSO56Ex1lQO XemrQ0WXMLYyfU0wz32LX0KFGpQ2+LNYfqlKx8hHpGaigJbuOFYLPt7SvGHiDmg9 X-Gm-Gg: AeBDiesBtnll3MCbRjmmH4YmOayXJrUJrvOkbFiTDvZAojC/UwhNXEIiWfUvqpo97WK s1Ioy1gseb1FnlWC9oicTMs9wioJy+nNyBdK1/wN2X/dsL3jWmvAxqgkNVMmLt8F/H744LXpkR3 Qm2TPy92o1k+w0iRaa5wP8giZsFMLJXnfY8KpkvxCta6HqY/pwXbDddOT7HDMn0rbiANCkFsu78 duLuVVrjl0F5SkTPe58W6IaVTC4Ye6WO0I7F6fHM9MoDtgHKnSmHJf853GpzYEdlLYh9GzLYQAP M72ej/FGNzRe8jhyuYNJjmwdn4GBqnUvR6x4oO1A4xxod6p9xgFKNo+hYe4LIp3OFTmM5lasfAF fUmK62f6c/OCGnUk8BuQPVKJQHrGhUPdSz8F4jsbjz5fbe1x8vhF9TAG0JNVHAP1SydL5ovozAj MsmnWouw/X6fiT/lVh/dI9piIb1UF3hlt0XaeYe1WqBg== X-Received: by 2002:aa7:88cc:0:b0:838:a61e:62cf with SMTP id d2e1a72fcca58-83a5bade5admr1156731b3a.11.1778031017318; Tue, 05 May 2026 18:30:17 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-839679c861esm4644886b3a.30.2026.05.05.18.30.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 May 2026 18:30:16 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: pgindent versus struct members and typedefs From: Chao Li In-Reply-To: Date: Wed, 6 May 2026 09:29:36 +0800 Cc: Tom Lane , Rahila Syed , Robert Haas , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <6356E089-A04E-4CAE-9385-C2ABD6844CD2@gmail.com> References: <347EA055-D626-414C-B10D-7E70041B9B55@gmail.com> <509793.1764715875@sss.pgh.pa.us> To: Nathan Bossart X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On May 6, 2026, at 05:47, Nathan Bossart = wrote: >=20 > On Tue, Dec 02, 2025 at 05:51:15PM -0500, Tom Lane wrote: >> Chao Li writes: >>> On Dec 3, 2025, at 06:00, Nathan Bossart = wrote: >>>> I tried to fix pgindent for a few, but the code is basically = impenetrable. >>>> I didn't find any fixes upstream [0], either. As noted above, we = could >>>> also fix it by avoiding the naming conflicts. However, I can't = imagine >>>> that's worth the churn, and I've already spent way too much time on = this, >>>> so IMHO the best thing to do here is nothing. >>=20 >>> I think that=E2=80=99s fine. >>=20 >> Agreed, not worth the trouble to fool with. >=20 > For fun, I spent some time with an AI tool to develop the attached fix = for > this problem. The explanation seems reasonable to me, although I am = by no > means a pgindent expert. When I looked at this in December, I did = find > this similar commit from upstream [0], but I failed to make the = connection > with last_u_d. 0002 is the result of a pgindent run after applying = 0001. > You'll notice that it fixes the exact set of cases I found with grep > upthread. >=20 > [0] https://github.com/pstef/freebsd_indent/commit/afa2239 >=20 > --=20 > nathan > = =46rom 0002, the fix looks good. I tried to run the patched pgindent = against all .c and .h files under src/ and contrib/, the result is = exactly the same as 0002. So, maybe worthy pushing before Tom running the annual pgindent. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/