Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dleLO-00007o-4Q for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Aug 2017 16:53:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dleLN-0002bQ-2P for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Aug 2017 16:53:57 +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 1dleLL-0002a7-Lo for pgsql-hackers@postgresql.org; Sat, 26 Aug 2017 16:53:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dleLI-0005TF-6b for pgsql-hackers@postgresql.org; Sat, 26 Aug 2017 16:53:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v7QGrj1e024851; Sat, 26 Aug 2017 12:53:46 -0400 From: Tom Lane To: Fabien COELHO cc: Robert Haas , Pavel Stehule , Corey Huinker , Daniel Verite , PostgreSQL Developers Subject: Re: Variable substitution in psql backtick expansion In-reply-to: References: <3926.1491159242@sss.pgh.pa.us> <13303.1503698976@sss.pgh.pa.us> <14596.1503701034@sss.pgh.pa.us> <20786.1503760136@sss.pgh.pa.us> Comments: In-reply-to Fabien COELHO message dated "Sat, 26 Aug 2017 18:40:05 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24849.1503766425.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 26 Aug 2017 12:53:45 -0400 Message-ID: <24850.1503766425@sss.pgh.pa.us> 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 Fabien COELHO writes: > So basically the only thing needed from Robert & you seems to change=20 > "11.0" to "11devel", which is fine with me. > The attached v5 does that. I think you are taking unreasonable shortcuts here: + SetVariable(pset.vars, "SERVER_VERSION_NAME", PQparameterStatus(pset.db, = "server_version")); The existing code in connection_warnings() does this: const char *server_version; /* Try to get full text form, might include "devel" etc */ server_version =3D PQparameterStatus(pset.db, "server_version"); /* Otherwise fall back on pset.sversion */ if (!server_version) { formatPGVersionNumber(pset.sversion, true, sverbuf, sizeof(sverbuf)); server_version =3D sverbuf; } and I think you should duplicate that logic verbatim. Now admittedly, server_version has been available for a long time, so that this might never matter in practice. But we shouldn't be doing this one way in one place and differently somewhere else. regards, tom lane --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers