Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cou2j-0005RO-66 for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Mar 2017 15:43:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cou2i-0000G8-Fj for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Mar 2017 15:43:52 +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 1cou1F-00065H-4d; Fri, 17 Mar 2017 15:42:21 +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 1cou1D-0007aM-0Y; Fri, 17 Mar 2017 15:42:19 +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 v2HFgATH011744; Fri, 17 Mar 2017 11:42:10 -0400 From: Tom Lane To: Fabien COELHO cc: Corey Huinker , Daniel Verite , "David G. Johnston" , Greg Stark , Erik Rijkers , Robert Haas , Jim Nasby , PostgreSQL , pgsql-hackers-owner@postgresql.org Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless) In-reply-to: References: <15875.1489440118@sss.pgh.pa.us> <24741.1489698878@sss.pgh.pa.us> <30537.1489761433@sss.pgh.pa.us> Comments: In-reply-to Fabien COELHO message dated "Fri, 17 Mar 2017 16:32:33 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11742.1489765330.1@sss.pgh.pa.us> Date: Fri, 17 Mar 2017 11:42:10 -0400 Message-ID: <11743.1489765330@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: >> I also fear that there are corner cases where the behavior would still >> be inconsistent. Consider >> >> \if ... >> \set foo `echo \endif should not appear here` > In this instance, ISTM that there is no problem. On "\if true", set is > executed, all is well. On "\if false", the whole line would be skipped > because the if-related commands are only expected on their own line, all > is well again. No problem. AFAICS, you misunderstood the example completely, or else you're proposing syntax restrictions that are even more bizarre and unintelligible than I thought before. We cannot have a situation where the syntax rules for backslash commands inside an \if are fundamentally different from what they are elsewhere; that's just going to lead to confusion and bug reports. 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