pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
Date: Tue, 05 Sep 2017 12:16:12 -0400
Message-ID: <2774.1504628172@sss.pgh.pa.us> (raw)
In-Reply-To: <CANP8+j+WC3zXTJrMQgfX1_TB23FmWzbiN71yWThb0N4gdvBgZQ@mail.gmail.com>
References: <E1dpFCX-0004YD-E7@gemulon.postgresql.org>
	<CANP8+j+WC3zXTJrMQgfX1_TB23FmWzbiN71yWThb0N4gdvBgZQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

[ redirecting to -hackers for wider comment ]

Simon Riggs <simon@2ndquadrant.com> writes:
> On 5 September 2017 at 07:51, Tom Lane <tgl@sss.pgh.pa.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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (18+ messages)  latest in thread

Message-ID: <2774.1504628172@sss.pgh.pa.us>
Permalink:  ../2774.1504628172@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2774.1504628172@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, simon@2ndquadrant.com
  Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
  In-Reply-To: <2774.1504628172@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox