Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctcIY-0007NL-Ad for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Mar 2017 15:47:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ctcIX-0005cV-TR for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Mar 2017 15:47:41 +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 1ctcGz-0008Fs-G7 for pgsql-hackers@postgresql.org; Thu, 30 Mar 2017 15:46:05 +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 1ctcGw-0006A7-No for pgsql-hackers@postgresql.org; Thu, 30 Mar 2017 15:46:04 +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 v2UFjpDt018082; Thu, 30 Mar 2017 11:45:51 -0400 From: Tom Lane To: Fabien COELHO cc: Corey Huinker , Daniel Verite , "David G. Johnston" , Greg Stark , Erik Rijkers , Robert Haas , Jim Nasby , PostgreSQL Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless) In-reply-to: References: <24980.1490748720@sss.pgh.pa.us> <21747.1490796899@sss.pgh.pa.us> <10990.1490847359@sss.pgh.pa.us> Comments: In-reply-to Fabien COELHO message dated "Thu, 30 Mar 2017 09:20:39 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18080.1490888751.1@sss.pgh.pa.us> Date: Thu, 30 Mar 2017 11:45:51 -0400 Message-ID: <18081.1490888751@sss.pgh.pa.us> 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 Fabien COELHO writes: >> [...] Aside from cosmetic changes, I've made it behave reasonably for >> cases where \if is used on portions of a query, for instance > A small issue I see is that I was planning to add such an if syntax to > pgbench (well, at least if I succeed in getting boolean expressions and > setting variables, which is just a maybe), but this kind of if in the > middle of expression does not make much sense for a pgbench script where > "if" must be evaluated at execution time, not parse time. Well, it's not really clear to me why that would be true. If it actually is impossible to give pgbench equivalent behavior, we'll just have to live with the discrepancy, but ISTM it could probably be made to work. 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