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.