Re: Getting psql to redisplay command after \e

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Getting psql to redisplay command after \e
Date: 2019-10-29 08:23:43
Message-ID: alpine.DEB.2.21.1910290915230.10013@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Tom,

> The attached patch teaches psql to redisplay any not-yet-executed
> query text after editing with \e.
>
> [...]

I've tested this patch. Although I agree that it is an improvement, I'm a
little at odd with the feature as is:

psql=> \e
# select 1...

then:

psql=> select 1...
psql-> <prompt>

I cannot move back with readline to edit further, I'm stuck there, which
is strange. I would prefer a simpler:

psql=> select 1...<prompt>

that would also be readline-aware, so that I know I'm there and ready to
nl but also to edit directly if I want that.

That would suggest to remove the ending newline rather than appending it,
and possibly to discuss a little bit with readline as well so that the
display line is also the current line for its point of view, so that it
can be edited further?

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2019-10-29 08:28:55 Re: [HACKERS] Block level parallel vacuum
Previous Message Konstantin Knizhnik 2019-10-29 08:04:52 Re: [Proposal] Global temporary tables