Re: BUG #16034: `\set ECHO all` doesn't work for \e command - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16034: `\set ECHO all` doesn't work for \e command
Date
Msg-id 28670.1570132797@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #16034: `\set ECHO all` doesn't work for \e command  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-bugs
"Daniel Verite" <daniel@manitou-mail.org> writes:
>>     Pavlo Golub wrote:
>>> \set ECHO queries
>>> would display them including immediately after \e in an interactive
>>> session.

>> Oh, great! That works! Thanks! But why ECHO all doesn't? Should all
>> include queries by default?

> As I understand,  "ECHO all" does nothing when the commands are
> read interactively. So in that mode it's the same as "ECHO none",
> and it doesn't seem very useful indeed.
> It appears to be an ancient decision, since it was  already
> described in the 7.1 docs pretty much like it is today:
> https://www.postgresql.org/docs/7.1/app-psql.html 

The reason why it doesn't echo commands in interactive mode is that
you presumably just typed the command (and had it echoed back at you,
by the tty driver if not readline), so echoing it again would be
duplicative and annoying.  I don't think we should add such annoyance
in normal cases as a band-aid for the problem with \e.

BTW, "ECHO all" and "ECHO queries" are totally different; the one
is not a superset of the other.  "all" prints lines as they are read,
the other prints commands when they are sent to the server.  One reason
why you don't want "ECHO all" to be active in interactive mode is that
it'd make a complete hash of things while typing a multiline query.

            regards, tom lane



pgsql-bugs by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: BUG #16034: `\set ECHO all` doesn't work for \e command
Next
From: Peter Geoghegan
Date:
Subject: Re: Write skew anmalies are found in SERIALIZABLE isolation