Commit 55ea144a authored by Bruce Momjian's avatar Bruce Momjian

Prevent psql version banner from being printed by the \c command if the

versions match, per report from Peter.
parent aa7e7ae9
......@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.214 2010/02/05 03:09:05 joe Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.215 2010/02/16 21:07:01 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
......@@ -1331,7 +1331,7 @@ do_connect(char *dbname, char *user, char *host, char *port)
PQsetNoticeProcessor(n_conn, NoticeProcessor, NULL);
pset.db = n_conn;
SyncVariables();
connection_warnings(); /* Must be after SyncVariables */
connection_warnings(false); /* Must be after SyncVariables */
/* Tell the user about the new connection */
if (!pset.quiet)
......@@ -1357,7 +1357,7 @@ do_connect(char *dbname, char *user, char *host, char *port)
void
connection_warnings(void)
connection_warnings(bool in_startup)
{
if (!pset.quiet && !pset.notty)
{
......@@ -1383,7 +1383,8 @@ connection_warnings(void)
printf(_("%s (%s, server %s)\n"),
pset.progname, PG_VERSION, server_version);
}
else
/* For version match, only print psql banner on startup. */
else if (in_startup)
printf("%s (%s)\n", pset.progname, PG_VERSION);
if (pset.sversion / 100 != client_ver / 100)
......
......@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.h,v 1.33 2010/01/02 16:57:59 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.h,v 1.34 2010/02/16 21:07:01 momjian Exp $
*/
#ifndef COMMAND_H
#define COMMAND_H
......@@ -34,7 +34,7 @@ extern bool do_pset(const char *param,
printQueryOpt *popt,
bool quiet);
extern void connection_warnings(void);
extern void connection_warnings(bool in_startup);
extern void SyncVariables(void);
......
......@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.160 2010/02/05 03:09:05 joe Exp $
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.161 2010/02/16 21:07:01 momjian Exp $
*/
#include "postgres_fe.h"
......@@ -294,7 +294,7 @@ main(int argc, char *argv[])
if (!options.no_psqlrc)
process_psqlrc(argv[0]);
connection_warnings();
connection_warnings(true);
if (!pset.quiet && !pset.notty)
printf(_("Type \"help\" for help.\n\n"));
if (!pset.notty)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment