Re: [PATCH] Add support to psql for edit-and-execute-command

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Joe Wildish <joe(at)lateraljoin(dot)com>
Cc: Oleksandr Shulgin <oleksandr(dot)shulgin(at)zalando(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Add support to psql for edit-and-execute-command
Date: 2020-05-18 10:09:16
Message-ID: CAFj8pRAVgz3o9ONvOiaPNrrj9SHRmk8jwQgf7RsH1yv_nf1qRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

po 18. 5. 2020 v 12:05 odesílatel Joe Wildish <joe(at)lateraljoin(dot)com> napsal:

> On 18 May 2020, at 7:08, Oleksandr Shulgin wrote:
>
> The only difference from \e is that you don't need to jump to the end of
> input first, I guess?
>
> AIUI, \e will edit the last thing in history or a specific line number
> from history, whereas the patch will allow the current line to be edited.
> That is 99% of the time what I want.
>
> My work flow is typically "Run some queries" => "Go back to some recent
> query by searching history, often not the most recent" => "Edit query". To
> do the edit in an editor (without the patch), I've been deliberately
> nobbling the query once found from history. This allows it to execute (and
> fail) but places it as the most recent thing in history. Then I hit "\e".
>

\e is working with not empty line too.You can check

select 1\e

Your patch just save skip on end line and \e

Personally I think so it is good idea

Pavel

-Joe
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Wildish 2020-05-18 10:16:19 Re: [PATCH] Add support to psql for edit-and-execute-command
Previous Message Joe Wildish 2020-05-18 10:04:56 Re: [PATCH] Add support to psql for edit-and-execute-command