From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
Cc: | PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Getting psql to redisplay command after \e |
Date: | 2019-10-29 16:06:07 |
Message-ID: | 24982.1572365167@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> writes:
>> 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 don't follow. readline doesn't allow you to edit already-entered lines
today, that is, after typing "select 1<return>" you see
regression=# select 1
regression-#
and there isn't any way to move back and edit the already-entered line
within readline. I agree it might be nicer if you could do that, but
that's *far* beyond the scope of this patch. It would take entirely
fundamental rethinking of our use of libreadline, if indeed it's possible
at all. I also don't see how we could have syntax-aware per-line prompts
if we were allowing readline to treat the whole query as one line.
In the larger picture, tinkering with how that works would affect
every psql user at the level of "muscle memory" editing habits,
and I suspect that their reactions would not be uniformly positive.
What I propose here doesn't affect anyone who doesn't use \e at all.
Even for \e users it doesn't have any effect on what you need to type.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2019-10-29 16:10:31 | Re: alternative to PG_CATCH |
Previous Message | Vik Fearing | 2019-10-29 15:59:40 | Re: Join Correlation Name |