Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpHGE-0002O2-4J for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Sep 2017 17:03:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dpHGD-0007AX-K1 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Sep 2017 17:03:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dpHEh-0004U7-VX for pgsql-hackers@postgreSQL.org; Tue, 05 Sep 2017 17:02:04 +0000 Received: from jiboia.ensmp.fr ([194.214.158.138] helo=cc-tupan-roaming-a.ensmp.fr) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpHEb-0007Ta-7P for pgsql-hackers@postgreSQL.org; Tue, 05 Sep 2017 17:02:03 +0000 Received: from cri.ensmp.fr (13.237.219.88.rev.sfr.net [88.219.237.13]) (authenticated bits=0) by cc-tupan-roaming-a.ensmp.fr (8.15.2/8.15.2/JMMC-22/Oct/2013) with ESMTPSA id v85H1qOf016861 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 Sep 2017 19:01:54 +0200 Date: Tue, 5 Sep 2017 19:01:52 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@lancre To: Tom Lane cc: Simon Riggs , PostgreSQL Developers Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version. In-Reply-To: <2774.1504628172@sss.pgh.pa.us> Message-ID: References: <2774.1504628172@sss.pgh.pa.us> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Miltered: at cc-tupan-roaming-a.ensmp.fr with ID 59AED880.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 59AED880.000 from 13.237.219.88.rev.sfr.net/13.237.219.88.rev.sfr.net/88.219.237.13/cri.ensmp.fr/ List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org >> 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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers