Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZhPB-0003iY-DA for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Feb 2017 17:12:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cZhPA-0001M7-S9 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Feb 2017 17:12:12 +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 1cZhNm-0007eW-7Y; Fri, 03 Feb 2017 17:10:46 +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 1cZhNj-0008P9-Mx; Fri, 03 Feb 2017 17:10:45 +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 v13HAZOJ025971; Fri, 3 Feb 2017 12:10:35 -0500 From: Tom Lane To: Corey Huinker cc: Fabien COELHO , Erik Rijkers , Jim Nasby , Daniel Verite , PostgreSQL , pgsql-hackers-owner@postgresql.org Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless) In-reply-to: References: <1084.1485886511@sss.pgh.pa.us> <3109.1486085543@sss.pgh.pa.us> <1927c741db54ebc5a93374df337591e1@xs4all.nl> Comments: In-reply-to Corey Huinker message dated "Fri, 03 Feb 2017 11:49:59 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25969.1486141835.1@sss.pgh.pa.us> Date: Fri, 03 Feb 2017 12:10:35 -0500 Message-ID: <25970.1486141835@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 Corey Huinker writes: > Well played (again). That one ranks up there with "and don't call me > Shirley." I meant in the specific psql-context, does it do anything other > than (attempt to) terminate sent-but-not-received SQL queries? It also flushes the input buffer. I think it is probably reasonable to let it cancel interactive \if state as well. A useful thought-experiment is to ask what behavior you'd want if we had metacommand loops ... and I think the answer there is pretty obvious: you'd want control-C to kill a loop. I'm less sure about what it ought to do when control is somewhere in a script file. I *think* we have things set up to kill execution of script files altogether, in which case we have the answer a fortiori. If not, there's room for discussion. 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