Re: pgindent to ignore build directories - Mailing list pgsql-hackers

From Jelte Fennema-Nio
Subject Re: pgindent to ignore build directories
Date
Msg-id CAGECzQR418jGdGMJHP5P1PDHtyC0ugXhG2eT94h8VvUGcS7D_g@mail.gmail.com
Whole thread
In response to Re: pgindent to ignore build directories  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgindent to ignore build directories
List pgsql-hackers
On Thu, 24 Sept 2026 at 16:29, Tom Lane <tgl@sss.pgh.pa.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@82:
Statement nesting error
Error@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.



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: PSQL schema "describe" \dn is not escaping quotes
Next
From: Michael Paquier
Date:
Subject: Re: ZSTD TOAST compression, and an extensible compression method encoding