Re: pg_upgrade should truncate/remove its logs before running

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Daniel Gustafsson <daniel@yesql.se>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Andrew Dunstan <andrew@dunslane.net>, Bruce Momjian <bruce@momjian.us>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@lists.postgresql.org
Date: 2021-12-22T07:47:12Z
Lists: pgsql-hackers
On Mon, Dec 20, 2021 at 09:39:26PM -0600, Justin Pryzby wrote:
> On Mon, Dec 20, 2021 at 08:21:51PM +0900, Michael Paquier wrote:
>> we could choose something simpler for the default, like
>> "pg_upgrade_log".  I don't have a good history in naming new things,
>> though :)
> 
> I specifically called it .d to made it obvious that it's a dir - nearly
> everything that ends in "log" is a file, so people are likely to run "rm" and
> "less" on it - including myself.

Okay.

>> .gitignore should be updated, I guess?
> 
> Are you suggesting to remove these ?
> -/pg_upgrade_internal.log
> -/loadable_libraries.txt

Yep, it looks so as these are part of the logs, the second one being a
failure state.

> -/reindex_hash.sql

But this one is not, no?

>> Besides, this patch has no documentation.
> 
> TBH I'm not even sure if the dir needs to be configurable ?

I'd think it is better to have some control on that.  Not sure what
the opinion of others is on this specific point, though.
--
Michael

Commits

  1. pg_upgrade: Move all the files generated internally to a subdirectory