Add version and data directory to initdb output - Mailing list pgsql-hackers

From David G. Johnston
Subject Add version and data directory to initdb output
Date
Msg-id CAKFQuwZjj0JXUSRed-nxNY1CRHkmcnkJ=J0zKhXM_pJ_P6sAGw@mail.gmail.com
Whole thread Raw
Responses Re: Add version and data directory to initdb output  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
Hackers,

initdb is already pretty chatty, and the version of the cluster being installed seems useful to include as well.  The data directory is probably less so - though I am thinking that the absolute path would be useful to report, especially when a relative path is specified (I didn't figure that part out yet, figured I'd get the idea approved before working out how to make it happen).

Moving "Success" to that "summary output" line and leaving the optional shell command line just be the shell command made sense to me.

diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index ab826da650..54a1d1fcac 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -3119,6 +3119,9 @@ main(int argc, char *argv[])
  "--auth-local and --auth-host, the next time you run initdb.");
  }
 
+ printf(_("\nSuccess. PostgreSQL version %s cluster has been initialized at %s.\n"), PG_VERSION, pg_data);
+ fflush(stdout);
+
  if (!noinstructions)
  {
  /*
@@ -3147,7 +3150,7 @@ main(int argc, char *argv[])
  /* translator: This is a placeholder in a shell command. */
  appendPQExpBuffer(start_db_cmd, " -l %s start", _("logfile"));
 
- printf(_("\nSuccess. You can now start the database server using:\n\n"
+ printf(_("\nYou can now start the database server using:\n\n"
  "    %s\n\n"),
    start_db_cmd->data);
 

David J.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Crash in new pgstats code
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Add TAP test to automate the equivalent of check_guc