Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
Date: 2017-09-05 17:01:52
Message-ID: alpine.DEB.2.20.1709051857100.17848@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers


>> This is good. Please can we backpatch these are far as they will go
>> (easily)? There is very little risk in doing so and significant
>> benefits in being able to rely on scripts that know about versions.
>
> Hm. I think it would be a fine idea to push this change into v10,
> so that all psql versions that have \if would have these variables.
> However, I'm less enthused about adding them to the 9.x branches.
> Given the lack of \if, I'm not seeing a use-case that would justify
> taking any compatibility risk for.
>
> Opinions anyone?

I think that it is harmless and useful for v10, and mostly useless for
previous versions.

ISTM that the hack looking like:

\if false \echo BAD VERSION \q \endif

Allow to test a prior 10 version and stop. However testing whether a
variable is defined is not included yet, so differenciating between 10 and
11 would not be easy... thus having 10 => version available would be
significantly helpful for scripting.

--
Fabien.

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2017-09-05 17:41:11 Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
Previous Message Tom Lane 2017-09-05 16:58:36 Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2017-09-05 17:09:22 Re: [Proposal] Allow users to specify multiple tables in VACUUM commands
Previous Message Tom Lane 2017-09-05 16:58:36 Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.