Re: proposal: psql concise mode

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: psql concise mode
Date: 2011-11-10 03:04:33
Message-ID: CAK3UJRGdirwtrAUJizzSpXxEqDA-H5y7Qpgc=+GK=pRCdaLf+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[Sorry for not CC'ing the list before, I'm still getting used to the
new Gmail interface]

On Tue, Nov 8, 2011 at 11:05 PM, Josh Kupershmidt <schmiddy(at)gmail(dot)com> wrote:
> On Tue, Nov 8, 2011 at 10:04 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Josh Kupershmidt <schmiddy(at)gmail(dot)com> writes:
>>> We're essentially pretending that we support all server versions with
>>> this code, instead of erroring out on some definite old version and
>>> admitting "sorry, can't do it". ...
>>> I think we should draw a line somewhere about just how far back psql
>>> must support,
>>
>> Says right at the top of the file:
>>
>>  * Support for the various \d ("describe") commands.  Note that the current
>>  * expectation is that all functions in this file will succeed when working
>>  * with servers of versions 7.4 and up.  It's okay to omit irrelevant
>>  * information for an old server, but not to fail outright.
>
> Oh, heh, I did miss that note. 7.4 is a reasonable target, I guess.
> It's not clear to me from that comment whether it's acceptable for the
> code to "fail outright" on servers older than 7.4, as in the snippet I
> posted, but I'm pretty sure that is what would happen. (I don't have a
> 7.x install handy to test that theory, as I haven't been able to build
> anything older than 8.0.)

FWIW, I just played around with 7.4 and 7.3 servers. (I had some bad
memories of the older tarballs not building, but that must have been
only on OS X -- I can build at least back to 7.3 on this Ubuntu 11.04
machine.)

Most meta-commands worked alright on 7.4, or at least failed
gracefully. The ones I saw which failed unexpectedly were \sf and \ef,
which complained:
ERROR: function pg_catalog.pg_get_functiondef(integer) does not exist

I think we need a server version check for these two meta-commands,
unless someone cares to make them work on < 8.4, trivial patch
attached.

As I suggested, many more unexpected failures (e.g. \dnS+) pop up when
talking to a 7.3 server. It's not a big deal, but it'd be nice if we
could instead error out with a "sorry, we're too lazy to try to
support 7.3" on the meta-commands which fail thusly, and make the
various "else" clauses more explicit about just how far back their
support really goes.

Josh

Attachment Content-Type Size
sf_ef_version_check.diff text/x-diff 1.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-11-10 03:12:40 Re: pg_dumpall Sets Roll default_tablespace Before Creating Tablespaces
Previous Message Robert Haas 2011-11-10 02:47:56 Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message