Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jyPVR-0001Bw-OC for pgsql-general@arkaria.postgresql.org; Thu, 23 Jul 2020 00:54:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jyPVQ-0002zX-MR for pgsql-general@arkaria.postgresql.org; Thu, 23 Jul 2020 00:54:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jyPVQ-0002zQ-Ea for pgsql-general@lists.postgresql.org; Thu, 23 Jul 2020 00:54:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jyPVI-0002Ec-RS for pgsql-general@postgresql.org; Thu, 23 Jul 2020 00:54:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 06N0sTAH089920; Wed, 22 Jul 2020 20:54:29 -0400 From: Tom Lane To: "David G. Johnston" cc: =?UTF-8?Q?Emanuel_Ara=C3=BAjo?= , "pgsql-general@postgresql.org" Subject: Re: psql \r changed behavior in pg10 In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Wed, 22 Jul 2020 17:14:00 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <89918.1595465669.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 22 Jul 2020 20:54:29 -0400 Message-ID: <89919.1595465669@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Wednesday, July 22, 2020, Emanuel Ara=C3=BAjo wrot= e: >> \r >> \e >> -> Open temp file with the same last command "select 1;" >> is it right? > Documentation since v10: > Or, if the current query buffer is empty, the most recently executed que= ry > is copied to a temporary file and edited in the same fashion. There's some discussion around that in this thread: https://www.postgresql.org/message-id/flat/9b4ea968-753f-4b5f-b46c-d7d3bf7= c8f90%40manitou-mail.org The key point is that \r in this case used to clear the "previous query" buffer since there was nothing for it to remove from the "current query" buffer. I argued then that that was confusing and counterproductive, and I still think that. regards, tom lane