Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuaKo-0006el-PU for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2017 07:54:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cuaKo-0003uY-42 for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2017 07:54:02 +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 1cuaJK-0001Hv-Qr for pgsql-hackers@postgresql.org; Sun, 02 Apr 2017 07:52:30 +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 1cuaJH-00079y-Ql for pgsql-hackers@postgresql.org; Sun, 02 Apr 2017 07:52:30 +0000 Received: from cri.ensmp.fr (28.237.219.88.rev.sfr.net [88.219.237.28]) (authenticated bits=0) by cc-tupan-roaming-b.ensmp.fr (8.15.2/8.15.2/JMMC-22/Oct/2013) with ESMTPSA id v327qPi0006812 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 2 Apr 2017 09:52:26 +0200 Date: Sun, 2 Apr 2017 09:52:25 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@lancre To: Pavel Stehule cc: 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 58E0ADB9.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: 58E0ADB9.000 from 28.237.219.88.rev.sfr.net/28.237.219.88.rev.sfr.net/88.219.237.28/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 > For this case can be nice to have function that returns server version as > number > > some like version_num() .. 10000 Another possible trick to get out of a script which does not support \if, relying on the fact that the unexpected command is simply ignored: -- exit version below 10 \if false \echo 'script requires version 10 or better' \q \endif Also possible but less informative on errors: \set ON_ERROR_STOP on \if false \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