Skip to content

Commit f5047c1

Browse files
committed
Move any remaining files generated by pg_upgrade into an internal subdir
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
1 parent 4d5d358 commit f5047c1

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

src/bin/pg_upgrade/check.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,9 @@ check_for_composite_data_type_usage(ClusterInfo *cluster)
12341234

12351235
prep_status("Checking for system-defined composite types in user tables");
12361236

1237-
snprintf(output_path, sizeof(output_path), "tables_using_composite.txt");
1237+
snprintf(output_path, sizeof(output_path), "%s/%s",
1238+
log_opts.basedir,
1239+
"tables_using_composite.txt");
12381240

12391241
/*
12401242
* Look for composite types that were made during initdb *or* belong to
@@ -1291,7 +1293,9 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
12911293

12921294
prep_status("Checking for reg* data types in user tables");
12931295

1294-
snprintf(output_path, sizeof(output_path), "tables_using_reg.txt");
1296+
snprintf(output_path, sizeof(output_path), "%s/%s",
1297+
log_opts.basedir,
1298+
"tables_using_reg.txt");
12951299

12961300
/*
12971301
* 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)
13441348

13451349
prep_status("Checking for incompatible \"jsonb\" data type");
13461350

1347-
snprintf(output_path, sizeof(output_path), "tables_using_jsonb.txt");
1351+
snprintf(output_path, sizeof(output_path), "%s/%s",
1352+
log_opts.basedir,
1353+
"tables_using_jsonb.txt");
13481354

13491355
if (check_for_data_type_usage(cluster, "pg_catalog.jsonb", output_path))
13501356
{

src/bin/pg_upgrade/version.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster)
183183

184184
prep_status("Checking for incompatible \"line\" data type");
185185

186-
snprintf(output_path, sizeof(output_path), "tables_using_line.txt");
186+
snprintf(output_path, sizeof(output_path), "%s/%s",
187+
log_opts.basedir,
188+
"tables_using_line.txt");
187189

188190
if (check_for_data_type_usage(cluster, "pg_catalog.line", output_path))
189191
{
@@ -221,7 +223,9 @@ old_9_6_check_for_unknown_data_type_usage(ClusterInfo *cluster)
221223

222224
prep_status("Checking for invalid \"unknown\" user columns");
223225

224-
snprintf(output_path, sizeof(output_path), "tables_using_unknown.txt");
226+
snprintf(output_path, sizeof(output_path), "%s/%s",
227+
log_opts.basedir,
228+
"tables_using_unknown.txt");
225229

226230
if (check_for_data_type_usage(cluster, "pg_catalog.unknown", output_path))
227231
{
@@ -364,7 +368,9 @@ old_11_check_for_sql_identifier_data_type_usage(ClusterInfo *cluster)
364368

365369
prep_status("Checking for invalid \"sql_identifier\" user columns");
366370

367-
snprintf(output_path, sizeof(output_path), "tables_using_sql_identifier.txt");
371+
snprintf(output_path, sizeof(output_path), "%s/%s",
372+
log_opts.basedir,
373+
"tables_using_sql_identifier.txt");
368374

369375
if (check_for_data_type_usage(cluster, "information_schema.sql_identifier",
370376
output_path))

0 commit comments

Comments
 (0)