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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
Date: 2017-09-05 16:16:12
Message-ID: 2774.1504628172@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

[ redirecting to -hackers for wider comment ]

Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> On 5 September 2017 at 07:51, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Add psql variables showing server version and psql version.
>>
>> We already had a psql variable VERSION that shows the verbose form of
>> psql's own version. Add VERSION_NAME to show the short form (e.g.,
>> "11devel") and VERSION_NUM to show the numeric form (e.g., 110000).
>> Also add SERVER_VERSION_NAME and SERVER_VERSION_NUM to show the short and
>> numeric forms of the server's version. (We'd probably add SERVER_VERSION
>> with the verbose string if it were readily available; but adding another
>> network round trip to get it seems too expensive.)
>>
>> The numeric forms, in particular, are expected to be useful for scripting
>> purposes, now that psql can do conditional tests.

> 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?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-09-05 16:29:41 Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
Previous Message Jacob Champion 2017-09-05 16:15:02 Re: [PATCH] Assert that the correct locks are held when calling PageGetLSN()

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2017-09-05 16:29:41 Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
Previous Message Tom Lane 2017-09-05 16:02:29 pgsql: In psql, use PSQL_PAGER in preference to PAGER, if it's set.