]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Move any remaining files generated by pg_upgrade into an internal subdir
authorMichael Paquier <michael@paquier.xyz>
Tue, 13 Sep 2022 01:38:59 +0000 (10:38 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 13 Sep 2022 01:38:59 +0000 (10:38 +0900)
This change concerns a couple of .txt files (for internal state checks)
that were still written in the path where the binary is executed, and
not in the subdirectory located in the target cluster.  Like the other
.txt files doing already so (like loadable_libraries.txt), these are
saved in the base output directory.  Note that on failure, the logs
report the full path to the .txt file generated, so these are easy to
find.

Oversight in 38bfae3.

Author: Daniel Gustafsson
Reviewed-by: Michael Paquier, Justin Prysby
Discussion: https://postgr.es/m/181A6DA8-3B7F-4B71-82D5-363FF0146820@yesql.se
Backpatch-through: 15

src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/version.c

index d9e764be62c8eb1d34a8233a5e8d023bce98d175..df719c6960463f86f929d1a1d9186dbf50ed155c 100644 (file)
@@ -1234,7 +1234,9 @@ check_for_composite_data_type_usage(ClusterInfo *cluster)
 
        prep_status("Checking for system-defined composite types in user tables");
 
-       snprintf(output_path, sizeof(output_path), "tables_using_composite.txt");
+       snprintf(output_path, sizeof(output_path), "%s/%s",
+                        log_opts.basedir,
+                        "tables_using_composite.txt");
 
        /*
         * Look for composite types that were made during initdb *or* belong to
@@ -1291,7 +1293,9 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
 
        prep_status("Checking for reg* data types in user tables");
 
-       snprintf(output_path, sizeof(output_path), "tables_using_reg.txt");
+       snprintf(output_path, sizeof(output_path), "%s/%s",
+                        log_opts.basedir,
+                        "tables_using_reg.txt");
 
        /*
         * Note: older servers will not have all of these reg* types, so we have
@@ -1344,7 +1348,9 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
 
        prep_status("Checking for incompatible \"jsonb\" data type");
 
-       snprintf(output_path, sizeof(output_path), "tables_using_jsonb.txt");
+       snprintf(output_path, sizeof(output_path), "%s/%s",
+                        log_opts.basedir,
+                        "tables_using_jsonb.txt");
 
        if (check_for_data_type_usage(cluster, "pg_catalog.jsonb", output_path))
        {
index c694558c3d665861fb9db1e628d98f5c7ad49536..20c61072a425376327be6fadcb26972718109f62 100644 (file)
@@ -183,7 +183,9 @@ old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster)
 
        prep_status("Checking for incompatible \"line\" data type");
 
-       snprintf(output_path, sizeof(output_path), "tables_using_line.txt");
+       snprintf(output_path, sizeof(output_path), "%s/%s",
+                        log_opts.basedir,
+                        "tables_using_line.txt");
 
        if (check_for_data_type_usage(cluster, "pg_catalog.line", output_path))
        {
@@ -221,7 +223,9 @@ old_9_6_check_for_unknown_data_type_usage(ClusterInfo *cluster)
 
        prep_status("Checking for invalid \"unknown\" user columns");
 
-       snprintf(output_path, sizeof(output_path), "tables_using_unknown.txt");
+       snprintf(output_path, sizeof(output_path), "%s/%s",
+                        log_opts.basedir,
+                        "tables_using_unknown.txt");
 
        if (check_for_data_type_usage(cluster, "pg_catalog.unknown", output_path))
        {
@@ -364,7 +368,9 @@ old_11_check_for_sql_identifier_data_type_usage(ClusterInfo *cluster)
 
        prep_status("Checking for invalid \"sql_identifier\" user columns");
 
-       snprintf(output_path, sizeof(output_path), "tables_using_sql_identifier.txt");
+       snprintf(output_path, sizeof(output_path), "%s/%s",
+                        log_opts.basedir,
+                        "tables_using_sql_identifier.txt");
 
        if (check_for_data_type_usage(cluster, "information_schema.sql_identifier",
                                                                  output_path))