Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1culYE-0003Ob-M7 for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2017 19:52: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 1culYD-00061E-Cl for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2017 19:52: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 1culWk-0003N5-95 for pgsql-hackers@postgresql.org; Sun, 02 Apr 2017 19:51:06 +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 1culWh-0004qx-Um for pgsql-hackers@postgresql.org; Sun, 02 Apr 2017 19:51:05 +0000 Received: from cri.ensmp.fr (17.56.69.86.rev.sfr.net [86.69.56.17]) (authenticated bits=0) by cc-tupan-roaming-b.ensmp.fr (8.15.2/8.15.2/JMMC-22/Oct/2013) with ESMTPSA id v32Jp063003049 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 2 Apr 2017 21:51:01 +0200 Date: Sun, 2 Apr 2017 21:50:59 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@lancre To: Corey Huinker cc: Pavel Stehule , Daniel Verite , Tom Lane , PostgreSQL Developers Subject: Re: Variable substitution in psql backtick expansion In-Reply-To: Message-ID: References: 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 58E15624.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: 58E15624.000 from 17.56.69.86.rev.sfr.net/17.56.69.86.rev.sfr.net/86.69.56.17/cri.ensmp.fr/ X-Pg-Spam-Score: -1.9 (-) 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 > src/tools/msvc/Solution.pm:s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) > #x\n#define __STRINGIFY2(z) __STRINGIFY(z)\n#define PG_VERSION_STR > "PostgreSQL $self->{strver}$extraver, compiled by Visual C++ build " > __STRINGIFY2(_MSC_VER) ", $bits-bit"}; Well, this is the same hack. > Without digging too deep, it seems like the redefinition wouldn't be > harmful, but it might make sense to not use the name STRINGIFY() if only to > avoid confusion with Solution.pm. It is the usual name for these macro. What would you suggest? >> - how desirable/useful is it to have this in 10? > > Extensions and extension-ish packages will love the _NUM vars. Hmmmm. I'm afraid pg extension scripts (for CREATE EXTENSION) are not executed through psql, but server side directly, so there is not much backslash-command support. > There's a lesser need for the _NAME vars. I put them more for error reporting, eg: \if :VERSION_NUM < 110000 \echo :VERSION_NAME is not supported, should be at least 11.0 \q \endif -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers