Re: pg_upgrade generated files in subdir follow-up - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: pg_upgrade generated files in subdir follow-up
Date
Msg-id 11FF20DA-4000-4765-B034-08378243CCC1@yesql.se
Whole thread Raw
In response to Re: pg_upgrade generated files in subdir follow-up  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_upgrade generated files in subdir follow-up
List pgsql-hackers
> On 31 Aug 2022, at 15:59, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Daniel Gustafsson <daniel@yesql.se> writes:
>> Commit 38bfae36526 moved the .txt files pg_upgrade generates to a separate
>> subdir, but there are a few left which are written to cwd.  The thread
>> resulting in that patch doesn't discuss these files specifically so it seems
>> they are just an oversight. Unless I'm missing something.
>
>> Should something the attached be applied to ensure all generated files are
>> placed in the subdirectory?
>
> It certainly looks inconsistent ATM.  I wondered if maybe the plan was to
> put routine output into the log directory but problem-reporting files
> into cwd --- but that isn't what's happening now.

Right, check_proper_datallowconn and check_for_isn_and_int8_passing_mismatch
and a few other check functions already place error reporting in the subdir.

> As long as we report the path to where the file is, I don't see a reason
> not to put problem-reporting files in the subdir too.

Agreed. The documentation states:

    "pg_upgrade creates various working files, such as schema dumps, stored
    within pg_upgrade_output.d in the directory of the new cluster.  Each
    run creates a new subdirectory named with a timestamp formatted as per
    ISO 8601 (%Y%m%dT%H%M%S), where all the generated files are stored."

The delete_old_cluster and reindex_hash scripts are still placed in CWD, which
isn't changed by this patch, as that seems correct (and might break scripts if
we move them).  Maybe we should amend the docs to mention that scripts aren't
generated in the subdir?

--
Daniel Gustafsson        https://vmware.com/




pgsql-hackers by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: SQL/JSON features for v15
Next
From: Andres Freund
Date:
Subject: Re: introduce bufmgr hooks