File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -458,30 +458,32 @@ main(int argc, char *argv[])
458458 if (minXlogSegNo > newXlogSegNo )
459459 newXlogSegNo = minXlogSegNo ;
460460
461+ if (noupdate )
462+ {
463+ PrintNewControlValues ();
464+ exit (0 );
465+ }
466+
461467 /*
462468 * If we had to guess anything, and -f was not given, just print the
463- * guessed values and exit. Also print if -n is given.
469+ * guessed values and exit.
464470 */
465- if (( guessed && !force ) || noupdate )
471+ if (guessed && !force )
466472 {
467473 PrintNewControlValues ();
468- if (!noupdate )
469- {
470- printf (_ ("\nIf these values seem acceptable, use -f to force reset.\n" ));
471- exit (1 );
472- }
473- else
474- exit (0 );
474+ pg_log_error ("not proceeding because control file values were guessed" );
475+ pg_log_error_hint ("If these values seem acceptable, use -f to force reset." );
476+ exit (1 );
475477 }
476478
477479 /*
478480 * Don't reset from a dirty pg_control without -f, either.
479481 */
480482 if (ControlFile .state != DB_SHUTDOWNED && !force )
481483 {
482- printf ( _ ( "The database server was not shut down cleanly.\n"
483- "Resetting the write-ahead log might cause data to be lost.\n"
484- "If you want to proceed anyway, use -f to force reset.\n" ) );
484+ pg_log_error ( " database server was not shut down cleanly" );
485+ pg_log_error_detail ( "Resetting the write-ahead log might cause data to be lost." );
486+ pg_log_error_hint ( "If you want to proceed anyway, use -f to force reset." );
485487 exit (1 );
486488 }
487489
You can’t perform that action at this time.
0 commit comments