Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlcja-0002Eo-Rf for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Aug 2017 15:10:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dlcjZ-0001KG-1x for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Aug 2017 15:10:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dlci0-0006xq-9n for pgsql-hackers@postgresql.org; Sat, 26 Aug 2017 15:09:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dlchs-0000DE-4t for pgsql-hackers@postgresql.org; Sat, 26 Aug 2017 15:09:11 +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 v7QF8u5k020787; Sat, 26 Aug 2017 11:08:56 -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> Comments: In-reply-to Fabien COELHO message dated "Sat, 26 Aug 2017 08:08:50 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20785.1503760136.1@sss.pgh.pa.us> Date: Sat, 26 Aug 2017 11:08:56 -0400 Message-ID: <20786.1503760136@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: >> OK, but if human-friendly display is the use-case then it ought to >> duplicate what psql itself would print in, eg, the startup message about >> server version mismatch. The v4 patch does not, in particular it neglects >> PQparameterStatus(pset.db, "server_version"). This would result in >> printing, eg, "11.0" when the user would likely rather see "11devel". > I understand that you would prefer VERSION_NAME to show something like > "11devel, server 9.6.4" No, that's not what I said. I'm just complaining that as the patch stands it will set SERVER_NAME to "11.0", where I think it should say "11devel" (as of today). > In summary, my prefered option is to have: > CLIENT_VERSION "PostgreSQL 11devel on ..." > CLIENT_VERSION_NAME "11devel" > CLIENT_VERSION_NUM 110000 I don't think we want to drop :VERSION; that would accomplish little beyond breaking existing scripts. Plausible choices include duplicating it, like: VERSION "PostgreSQL 11devel on ..." CLIENT_VERSION "PostgreSQL 11devel on ..." CLIENT_VERSION_NAME "11devel" CLIENT_VERSION_NUM 110000 or just ignoring the discrepancy: VERSION "PostgreSQL 11devel on ..." CLIENT_VERSION_NAME "11devel" CLIENT_VERSION_NUM 110000 or just leaving "CLIENT" implicit for all of these variables: VERSION "PostgreSQL 11devel on ..." VERSION_NAME "11devel" VERSION_NUM 110000 Robert seems to prefer the last of those, and that'd be fine with me. (Note that CLIENT is ambiguous anyway: does it mean psql itself, or libpq?) > SERVER_VERSION_NAME "9.6.4" > SERVER_VERSION_NUM 090604 I'm on board with this, except I don't think we should have any leading zero in the numeric form. There are contexts where somebody might think that means octal. 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