Re: BUG #16034: `\set ECHO all` doesn't work for \e command

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16034: `\set ECHO all` doesn't work for \e command
Дата
Msg-id 28670.1570132797@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #16034: `\set ECHO all` doesn't work for \e command  ("Daniel Verite" <daniel@manitou-mail.org>)
Список 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 по дате отправления:

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: BUG #16034: `\set ECHO all` doesn't work for \e command
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Write skew anmalies are found in SERIALIZABLE isolation