psql \r command is working? - Mailing list pgsql-hackers

From Sergei Kornilov
Subject psql \r command is working?
Date
Msg-id 646051566224264@myt1-b07549ac5f5f.qloud-c.yandex.net
Whole thread Raw
Responses Re: psql \r command is working?
List 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



pgsql-hackers by date:

Previous
From: Roman Pekar
Date:
Subject: Re: (select query)/relation as first class citizen
Next
From: Alvaro Herrera
Date:
Subject: Re: Unused header file inclusion