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 1wKNbr-000uOz-10 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 May 2026 21:47:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wKNbo-00E8WS-1x for pgsql-hackers@arkaria.postgresql.org; Tue, 05 May 2026 21:47:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wKNbo-00E8WK-0u for pgsql-hackers@lists.postgresql.org; Tue, 05 May 2026 21:47:16 +0000 Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wKNbm-00000000ijk-0Hqv for pgsql-hackers@lists.postgresql.org; Tue, 05 May 2026 21:47:16 +0000 Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-8b5232009a6so46619016d6.1 for ; Tue, 05 May 2026 14:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778017632; x=1778622432; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=PQrr/Y0UtfYkUy4dMiSFEJpa0/vGNCuZyU4n4UTfRZk=; b=p6seg7qbABZ59Ylp7ZDmONwIy4Y0/hZhRDv6ucqqTh8bv0nU4vGN463RCGDiCggLdZ kUGGgdPv9U3pS3SKbRuB/HyYkiWJTT+pHxyMd/9iFxPw+59S3sAWZcqRp2A56zYO/yE2 MDrQLbPR9wryJCLx6p6gRczCQu5HnnREcuy/FRbl583af0FThhixiClXJ/HJrXIGijvw p02beJUtc7XA1F6L73zTqxWdBvjpnjqhGwHmjhaZGjoGqGXM2jXKpX4zI7HSbH9HBAhe ftTNApdeB2VxD5B961Cqt/h9NjiwB9npnt85hgyZ2eK2PbnAnH5hV8nzfFdviHgZFHQN 90tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778017632; x=1778622432; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PQrr/Y0UtfYkUy4dMiSFEJpa0/vGNCuZyU4n4UTfRZk=; b=QhZMwe3f3mbLcf0FoZOJlOEEHVQqF1e8y6RQ+CGhMww6+mIcji+rFFzwMlZHuwR2oH SYX499y1VFUo1fnBDHR6AjlKRjNJLiNzJ9hqGrtN7w/Ujv0TJbwWTwOLtwIvEMHkGjJo xH8lVItu4fb93apzpQbp4sPzYUPvujH6o1JsqL8YZgdpLesRVYfeiR/LOd2x4oknvhhS UZ5TDua6StC4IEaal5icQG02nhrxErNQ5bUV3bJbOuaVBkVKYiexH6sniNGED8OTX87r RQYYDNBMN9Aa/wGmOl+uws/NqbQZ+z8GhlgHyCIWcRHPiJEEDsSVvaZtsZXQi1a5qIAf 1xbQ== X-Forwarded-Encrypted: i=1; AFNElJ/VA3+JcBbOOosoiKJCPqE5DC3GiROqriXFJb6SX++VWEF7L91rqrhP8hqDBiQaV3GVbwd3j9iSOlse8lwM@lists.postgresql.org X-Gm-Message-State: AOJu0Yz/sS9Ya39kPxIiTwApBEh41e23pXMrpj6ek7bal7BDCz2OR5oj 6fOvwvjLPVJwve5UAqh6LYUWqhA+rcWBpCsTnwrZIq5TPf3hrc9XMwxk X-Gm-Gg: AeBDietxN7z9ERXpg2mwJVHejPw/mzPmJzBYVft0a8xpvJDD0J1EnHjkBRtpYZYmJd0 4zJD5CZRbwusrIzWxziBVoFhm8JwWpd5mMCszdVN0ZoguL5mZ2KdOXsCEsJmLAs/2STO5jU0mix SNURuKWaVIjdHcpQhKDIptm6t2NFiB5nJx8fIEZEhVtfAYcaHXMggzO76kUm6yLeP6bRKTaYFAw g6eImZ0fa5ejPYhA30C0xO4M2wuL1MFtqMVoq8ydd35OcDY7X2PmcZ9Cr2kxOZBRZWvhS/6DlOl eFkj5j2aRH4fJEkY/lIPvIRVxylPlhHIHKH2BU043MuImpd1lQloYyP8yqsl9UXVoZu/MkxsEoQ YKDGySjwrOuE4emnKS9O6pnK+tKZYFnr5jRXHCW2MLInqMZz0wMVNDGvNJMg+4b+dUtsSBeQAAC /YdvOIN4ZAag95i/5MTPL1GORKytHB3J7aFVTWLJUgfoqXXwGhtw9N/j5NvmKhWEkB2/C83gVj/ 6speURqFoDahvvl1kq8q8M7RPLW0vuO X-Received: by 2002:a05:6214:46a0:b0:8ac:b5e0:bf92 with SMTP id 6a1803df08f44-8bc422a61f2mr9431776d6.9.1778017631876; Tue, 05 May 2026 14:47:11 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8b5397bdc7bsm166157406d6.20.2026.05.05.14.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 14:47:09 -0700 (PDT) Date: Tue, 5 May 2026 16:47:07 -0500 From: Nathan Bossart To: Tom Lane Cc: Chao Li , Rahila Syed , Robert Haas , PostgreSQL Hackers Subject: Re: pgindent versus struct members and typedefs Message-ID: References: <347EA055-D626-414C-B10D-7E70041B9B55@gmail.com> <509793.1764715875@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="k2Vi/uo5iFea1Gni" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <509793.1764715875@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --k2Vi/uo5iFea1Gni Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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. > >> I think that’s fine. > > Agreed, not worth the trouble to fool with. 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. [0] https://github.com/pstef/freebsd_indent/commit/afa2239 -- nathan --k2Vi/uo5iFea1Gni Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v1-0001-pgindent-Fix-spacing-after-when-member-name-match.patch