From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: Pavlo Golub <pavlo.golub@cybertec.at>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16034: `\set ECHO all` doesn't work for \e command
Date: Thu, 03 Oct 2019 15:59:57 -0400
Message-ID: <28670.1570132797@sss.pgh.pa.us> (raw)
In-Reply-To: <1c0128a5-0507-4e53-902e-f1a4596b267e@manitou-mail.org>
References: <1c0128a5-0507-4e53-902e-f1a4596b267e@manitou-mail.org>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, daniel@manitou-mail.org, pavlo.golub@cybertec.at
Subject: Re: BUG #16034: `\set ECHO all` doesn't work for \e command
In-Reply-To: <28670.1570132797@sss.pgh.pa.us>
References: <1c0128a5-0507-4e53-902e-f1a4596b267e@manitou-mail.org> <28670.1570132797@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox