Add version and data directory to initdb output

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Add version and data directory to initdb output
Date: 2022-04-15 23:50:08
Message-ID: CAKFQuwZjj0JXUSRed-nxNY1CRHkmcnkJ=J0zKhXM_pJ_P6sAGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-04-16 01:02:51 Re: pgsql: Add TAP test to automate the equivalent of check_guc
Previous Message Tom Lane 2022-04-15 23:14:32 Re: Crash in new pgstats code