diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index 47fa934db5..213b87c539 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -161,6 +161,11 @@ void slashUsage(unsigned short int pager) { FILE *output; + char *currdb; + + currdb = PQdb(pset.db); + if (currdb == NULL) + currdb = _("none"); output = PageOutput(86, pager); @@ -246,7 +251,7 @@ slashUsage(unsigned short int pager) fprintf(output, _("Connection\n")); fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n" " connect to new database (currently \"%s\")\n"), - PQdb(pset.db)); + currdb); fprintf(output, _(" \\encoding [ENCODING] show or set client encoding\n")); fprintf(output, _(" \\password [USERNAME] securely change the password for a user\n")); fprintf(output, "\n");