Re: pgindent to ignore build directories

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgindent to ignore build directories
Date: 2026-09-28 03:11:38
Message-ID: CAGECzQR418jGdGMJHP5P1PDHtyC0ugXhG2eT94h8VvUGcS7D_g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 24 Sept 2026 at 16:29, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I object to this patch. src/tools/pgindent/README documents that
> the presence of those files is useful for detecting where pgindent
> failed. Without them there's not an easy signal.

Hard disagree. I don't think BAK files serve that purpose well, and
they should be removed always imo (or possibly not even created in the
first place). There are two much better signals for detecting whether
and how pgindent fails:
1. stderr of pgindent
2. exit code of pgindent

The BAK files have useless names (e.g. pgsrcq4373.BAK). So if you want
to use them to detect where pgindent failed you have to look at their
contents and figure out the original based on that. While stderr
actually shows you what file failed and what the problem was, e.g.:

Failure in ./build/src/backend/bootstrap/bootparse.h: Error(at)82:
Statement nesting error
Error(at)113: Stuff missing from end of file

But I do agree that the pgindent README should call out these better
methods when changing the BAK file behaviour.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-09-28 03:13:02 Re: ZSTD TOAST compression, and an extensible compression method encoding
Previous Message Peter Smith 2026-09-28 02:54:22 Re: PSQL schema "describe" \dn is not escaping quotes