Re: [HACKERS] [COMMITTERS] pgsql: Add psql variables showing serverversion and psql version. - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [HACKERS] [COMMITTERS] pgsql: Add psql variables showing serverversion and psql version.
Date
Msg-id alpine.DEB.2.20.1709051857100.17848@lancre
Whole thread Raw
In response to Re: [HACKERS] [COMMITTERS] pgsql: Add psql variables showing server version and psql version.  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
Next
From: "Bossart, Nathan"
Date:
Subject: Re: [HACKERS] [Proposal] Allow users to specify multiple tables inVACUUM commands