Re: psql \r changed behavior in pg10

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Emanuel Araújo <eacshm(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql \r changed behavior in pg10
Date: 2020-07-23 00:54:29
Message-ID: 89919.1595465669@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Wednesday, July 22, 2020, Emanuel Araújo <eacshm(at)gmail(dot)com> wrote:
>> \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 query
> 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-d7d3bf7c8f90%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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Samarendra Sahoo 2020-07-23 10:06:42 Re: How to enable TDE on Postgresql 12.3 deployed using Kubernetes
Previous Message David G. Johnston 2020-07-23 00:36:07 Re: psql \r changed behavior in pg10