@@ -147,10 +147,9 @@ report_clusters_compatible(void)
147
147
}
148
148
149
149
pg_log (PG_REPORT , "\n"
150
- "| If pg_upgrade fails after this point, you must\n"
151
- "| re-initdb the new cluster before continuing.\n"
152
- "| You will also need to remove the \".old\" suffix\n"
153
- "| from %s/global/pg_control.old.\n" , old_cluster .pgdata );
150
+ "If pg_upgrade fails after this point, you must re-initdb the new cluster\n"
151
+ "before continuing. You will also need to remove the \".old\" suffix from\n"
152
+ "%s/global/pg_control.old.\n" , old_cluster .pgdata );
154
153
}
155
154
156
155
@@ -198,21 +197,20 @@ output_completion_banner(char *deletion_script_file_name)
198
197
/* Did we copy the free space files? */
199
198
if (GET_MAJOR_VERSION (old_cluster .major_version ) >= 804 )
200
199
pg_log (PG_REPORT ,
201
- "| Optimizer statistics are not transferred by pg_upgrade\n"
202
- "| so consider running:\n"
203
- "| \tvacuumdb --all --analyze-only\n"
204
- "| on the newly-upgraded cluster.\n\n" );
200
+ "Optimizer statistics are not transferred by pg_upgrade so consider \n"
201
+ "running:\n"
202
+ " vacuumdb --all --analyze-only\n"
203
+ "on the newly-upgraded cluster.\n\n" );
205
204
else
206
205
pg_log (PG_REPORT ,
207
- "| Optimizer statistics and free space information\n"
208
- "| are not transferred by pg_upgrade so consider\n"
209
- "| running:\n"
210
- "| \tvacuumdb --all --analyze\n"
211
- "| on the newly-upgraded cluster.\n\n" );
206
+ "Optimizer statistics and free space information are not transferred\n"
207
+ "by pg_upgrade so consider running:\n"
208
+ " vacuumdb --all --analyze\n"
209
+ "on the newly-upgraded cluster.\n\n" );
212
210
213
211
pg_log (PG_REPORT ,
214
- "| Running this script will delete the old cluster's data files:\n"
215
- "| \t %s\n" ,
212
+ "Running this script will delete the old cluster's data files:\n"
213
+ " %s\n" ,
216
214
deletion_script_file_name );
217
215
}
218
216
@@ -427,8 +425,8 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
427
425
os_info .cwd , SCRIPT_EXT );
428
426
429
427
if ((script = fopen (* deletion_script_file_name , "w" )) == NULL )
430
- pg_log (PG_FATAL , "Could not create necessary file: %s\n" ,
431
- * deletion_script_file_name );
428
+ pg_log (PG_FATAL , "Could not open file \"%s\": %s\n" ,
429
+ * deletion_script_file_name , getErrorText ( errno ) );
432
430
433
431
#ifndef WIN32
434
432
/* add shebang header */
@@ -477,8 +475,8 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
477
475
478
476
#ifndef WIN32
479
477
if (chmod (* deletion_script_file_name , S_IRWXU ) != 0 )
480
- pg_log (PG_FATAL , "Could not add execute permission to file: %s\n" ,
481
- * deletion_script_file_name );
478
+ pg_log (PG_FATAL , "Could not add execute permission to file \"%s\": %s\n" ,
479
+ * deletion_script_file_name , getErrorText ( errno ) );
482
480
#endif
483
481
484
482
check_ok ();
@@ -600,10 +598,11 @@ check_for_isn_and_int8_passing_mismatch(ClusterInfo *cluster)
600
598
{
601
599
found = true;
602
600
if (script == NULL && (script = fopen (output_path , "w" )) == NULL )
603
- pg_log (PG_FATAL , "Could not create necessary file: %s\n" , output_path );
601
+ pg_log (PG_FATAL , "Could not open file \"%s\": %s\n" ,
602
+ output_path , getErrorText (errno ));
604
603
if (!db_used )
605
604
{
606
- fprintf (script , "Database: %s\n" , active_db -> db_name );
605
+ fprintf (script , "Database: %s\n" , active_db -> db_name );
607
606
db_used = true;
608
607
}
609
608
fprintf (script , " %s.%s\n" ,
@@ -623,15 +622,13 @@ check_for_isn_and_int8_passing_mismatch(ClusterInfo *cluster)
623
622
{
624
623
pg_log (PG_REPORT , "fatal\n" );
625
624
pg_log (PG_FATAL ,
626
- "| Your installation contains \"contrib/isn\" functions\n"
627
- "| which rely on the bigint data type. Your old and\n"
628
- "| new clusters pass bigint values differently so this\n"
629
- "| cluster cannot currently be upgraded. You can\n"
630
- "| manually upgrade data that use \"contrib/isn\"\n"
631
- "| facilities and remove \"contrib/isn\" from the\n"
632
- "| old cluster and restart the upgrade. A list\n"
633
- "| of the problem functions is in the file:\n"
634
- "| \t%s\n\n" , output_path );
625
+ "Your installation contains \"contrib/isn\" functions which rely on the\n"
626
+ "bigint data type. Your old and new clusters pass bigint values\n"
627
+ "differently so this cluster cannot currently be upgraded. You can\n"
628
+ "manually upgrade databases that use \"contrib/isn\" facilities and remove\n"
629
+ "\"contrib/isn\" from the old cluster and restart the upgrade. A list of\n"
630
+ "the problem functions is in the file:\n"
631
+ " %s\n\n" , output_path );
635
632
}
636
633
else
637
634
check_ok ();
@@ -657,7 +654,7 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
657
654
bool found = false;
658
655
char output_path [MAXPGPATH ];
659
656
660
- prep_status ("Checking for reg* system oid user data types" );
657
+ prep_status ("Checking for reg* system OID user data types" );
661
658
662
659
snprintf (output_path , sizeof (output_path ), "%s/tables_using_reg.txt" ,
663
660
os_info .cwd );
@@ -702,10 +699,11 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
702
699
{
703
700
found = true;
704
701
if (script == NULL && (script = fopen (output_path , "w" )) == NULL )
705
- pg_log (PG_FATAL , "Could not create necessary file: %s\n" , output_path );
702
+ pg_log (PG_FATAL , "Could not open file \"%s\": %s\n" ,
703
+ output_path , getErrorText (errno ));
706
704
if (!db_used )
707
705
{
708
- fprintf (script , "Database: %s\n" , active_db -> db_name );
706
+ fprintf (script , "Database: %s\n" , active_db -> db_name );
709
707
db_used = true;
710
708
}
711
709
fprintf (script , " %s.%s.%s\n" ,
@@ -726,13 +724,12 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
726
724
{
727
725
pg_log (PG_REPORT , "fatal\n" );
728
726
pg_log (PG_FATAL ,
729
- "| Your installation contains one of the reg* data types in\n"
730
- "| user tables. These data types reference system oids that\n"
731
- "| are not preserved by pg_upgrade, so this cluster cannot\n"
732
- "| currently be upgraded. You can remove the problem tables\n"
733
- "| and restart the upgrade. A list of the problem columns\n"
734
- "| is in the file:\n"
735
- "| \t%s\n\n" , output_path );
727
+ "Your installation contains one of the reg* data types in user tables.\n"
728
+ "These data types reference system OIDs that are not preserved by\n"
729
+ "pg_upgrade, so this cluster cannot currently be upgraded. You can\n"
730
+ "remove the problem tables and restart the upgrade. A list of the problem\n"
731
+ "columns is in the file:\n"
732
+ " %s\n\n" , output_path );
736
733
}
737
734
else
738
735
check_ok ();
0 commit comments