Skip site navigation (1) Skip section navigation (2)

Re: PSQL commands not backwards-compatible

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-bugs(at)postgresql(dot)org,Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: PSQL commands not backwards-compatible
Date: 2005-08-31 18:05:13
Message-ID: 3278.1125511513@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
Josh Berkus <josh(at)agliodbs(dot)com> writes:
> Hmmm ... how difficult would it be to give a useful error message instead of a 
> SQL error?  Something like:

> "I'm sorry, that PSQL command did not work.  Most likely, you are connecting 
> to a different version of PostgreSQL."

Well, "useful" is in the eye of the beholder ... in particular, if you are
trying to debug a problem with the \d commands, you would want to see
the actual backend message.  OTOH you would probably also want to see
the query actually issued.  So maybe we could make this conditional on
the -E mode?

	if -E:	print the actual backend error message, as now

	else: print "Query failed, probably because backend is a different Postgres release"

Also, we can *know* rather than guess whether the backend is a different
major version, so maybe do the "user-friendly" printout only if (a) not -E
mode and (b) there is a version discrepancy.  If there's not a version
discrepancy then the failure is unexpected and we shouldn't be hiding
information about it.

I like this better than Bruce's recent proposal to print a warning at
psql startup, because it emits the info when you actually need it.
How many people pay attention to psql's startup banner at all?

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Jim C. NasbyDate: 2005-08-31 19:09:38
Subject: Re: PSQL commands not backwards-compatible
Previous:From: Josh BerkusDate: 2005-08-31 17:00:11
Subject: Re: PSQL commands not backwards-compatible

pgsql-patches by date

Next:From: Jim C. NasbyDate: 2005-08-31 19:09:38
Subject: Re: PSQL commands not backwards-compatible
Previous:From: Josh BerkusDate: 2005-08-31 17:00:11
Subject: Re: PSQL commands not backwards-compatible

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group