Re: [HACKERS] Version number in psql banner

Bruce Momjian <pgman@candle.pha.pa.us>

From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Darcy Buskermolen <darcy@wavefire.com>, Peter Eisentraut <peter_e@gmx.net>, PostgreSQL-patches <pgsql-patches@postgresql.org>
Date: 2005-09-03T00:39:52Z
Lists: pgsql-hackers

Attachments

Tom Lane wrote:
> Darcy Buskermolen <darcy@wavefire.com> writes:
> > Yes I've seen the same frustration from users,  I think the banner should say
> > something along the lines of "psql client version foo connected to server bar
> > version sfoo" 
> 
> That seems overly verbose, particularly in the normal case where the
> versions are indeed the same.  I could live with seeing a display like
> that when the versions are different.
> 
> The other question is what counts as "different" --- do we want to
> complain like this if the minor versions are different?

I updated the patch.  This gives psql three output displays on startup:

full match:

	Welcome to psql 8.1beta1, the PostgreSQL interactive terminal.

major match:

	Welcome to psql, the PostgreSQL interactive terminal.
	psql version 8.19, server version 8.1

and non-major match:
	
	WARNING:  You are connected to a server with major version 8.1,
	but your psql client is major version 8.2.  Informational backslash
	commands, like \d, might not work properly.
	
	Welcome to psql, the PostgreSQL interactive terminal.
	psql version 8.29, server version 8.1

Patch attached.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073