Re: Confusing behavior of psql's \e

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Confusing behavior of psql's \e
Date: 2020-12-01 16:34:19
Message-ID: 5FC6708B.4000303@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/01/20 11:21, Laurenz Albe wrote:
> On Tue, 2020-12-01 at 11:03 -0500, Chapman Flack wrote:
>>> complain about it, so I propose to clear the query buffer if the
>>> editor exits without modifying the file.
>>
>> Or how about keeping the query buffer content unchanged, but not
>> executing it? Then it's still there if you have another idea about
>> editing it. It's easy enough to \r if you really want it gone.
>
> What if the buffer was empty? Would you want to get the previous
> query in the query buffer? I'd assume not...

I took your proposal to be specifically about what happens if the editor
is exited with no change to the buffer, and in that case, I would suggest
making no change to the buffer, but not re-executing it.

If the editor is exited after deliberately emptying the editor buffer,
I would expect that to be treated as emptying the query buffer.

I don't foresee any case that would entail bringing a /previous/ query
back into the query buffer.

Regards,
-Chap

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zidenberg, Tsahi 2020-12-01 16:41:24 Re: Improving spin-lock implementation on ARM.
Previous Message Magnus Hagander 2020-12-01 16:32:21 Re: Add session statistics to pg_stat_database