Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpfZ6-0005pe-OJ for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Sep 2017 19:00:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dpfZ6-00076o-Ay for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Sep 2017 19:00:44 +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 1dpfXY-0004JL-HO for pgsql-hackers@postgresql.org; Wed, 06 Sep 2017 18:59:08 +0000 Received: from boipeva.ensmp.fr ([194.214.158.136] helo=cc-tupan-roaming-b.ensmp.fr) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpfXR-0007qt-Kt for pgsql-hackers@postgresql.org; Wed, 06 Sep 2017 18:59:07 +0000 Received: from cri.ensmp.fr (13.237.219.88.rev.sfr.net [88.219.237.13]) (authenticated bits=0) by cc-tupan-roaming-b.ensmp.fr (8.15.2/8.15.2/JMMC-22/Oct/2013) with ESMTPSA id v86Iwwwh025414 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Sep 2017 20:58:58 +0200 Date: Wed, 6 Sep 2017 20:58:57 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@lancre To: Tom Lane cc: Simon Riggs , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version. In-Reply-To: <31190.1504723050@sss.pgh.pa.us> Message-ID: References: <2774.1504628172@sss.pgh.pa.us> <4782.1504630716@sss.pgh.pa.us> <18953.1504705115@sss.pgh.pa.us> <2597.1504714572@sss.pgh.pa.us> <31190.1504723050@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-b.ensmp.fr with ID 59B04572.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: 59B04572.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 >> Thus short, simple but meaningful examples which show how to do something >> useful with all that in the documentation may help people take advantage >> of these new features. > > I don't have an objection to providing an example. I wasn't terribly > impressed with Simon's version, but maybe we can do better. That was just a quick idea to show how they could be used, probably it can be improved. > I think it should be concrete, not partly abstract; and likely it needs > to be with \if not the variable proper. ISTM that currently there is no "not". Maybe I do not understand your sentence. >> Given my experience with "\d*", I'm not sure I would assume that a new >> psql feature would work with older servers. > > I don't recall anyone questioning whether PQserverVersion() would work > with older servers. Being able to tell what version the server is is > sort of the point, no? If there were a restriction on what it would > work with, I would agree that that needs to be documented. But I > don't think "yes, it really works" is a helpful use of documentation > space. Sure. I can use psql without knowing that there is a libpq underneath, that it contains a PQserverVersion function implemented since pg7, and that the SERVER_VERSION_* variables introduced in pg10 or pg11 rely on that thus it should work with pg7/8/9 as well. It is not obvious, as a new feature could depend on any combination of server side functions, protocol extension, client library functions or client code... -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers