Re: proposal: psql concise mode

Поиск
Список
Период
Сортировка
От Josh Kupershmidt
Тема Re: proposal: psql concise mode
Дата
Msg-id CAK3UJRGdirwtrAUJizzSpXxEqDA-H5y7Qpgc=+GK=pRCdaLf+g@mail.gmail.com
обсуждение исходный текст
Ответ на proposal: psql concise mode  (Josh Kupershmidt <schmiddy@gmail.com>)
Ответы Re: proposal: psql concise mode  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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@gmail.com> wrote:
> On Tue, Nov 8, 2011 at 10:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Josh Kupershmidt <schmiddy@gmail.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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_dumpall Sets Roll default_tablespace Before Creating Tablespaces