psql \r command is working?

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: psql \r command is working?
Date: 2019-08-19 14:17:44
Message-ID: 646051566224264@myt1-b07549ac5f5f.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

Is psql command \r actually works? I expected \r and then \e command should start editor without text of last query.

LANG=C EDITOR=cat psql
psql (11.5 (Debian 11.5-1.pgdg100+1))
Type "help" for help.

melkij=> select 1;
?column?
----------
1
(1 row)

melkij=> \r
Query buffer reset (cleared).
melkij=> \e
select 1;
?column?
----------
1
(1 row)

Buffer is still here, in normal external editors too.
Same test on REL9_6_STABLE:

postgres=# select 1;
?column?
----------
1
(1 row)

postgres=# \r
Query buffer reset (cleared).
postgres=# \e

Buffer was actually cleared.

I see this behavior change on >= 10 versions

regards, Sergei

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-08-19 14:22:14 Re: Unused header file inclusion
Previous Message Roman Pekar 2019-08-19 14:16:18 Re: (select query)/relation as first class citizen