psql _ and \e -- what does clearing the query buffer actually do?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема psql _ and \e -- what does clearing the query buffer actually do?
Дата
Msg-id CAHyXU0zzvirqhp_4ioipOKRGFc8rvt1RO3sVXNJxzx-LHCdTzA@mail.gmail.com
обсуждение исходный текст
Ответы Re: psql _ and \e -- what does clearing the query buffer actually do?
Список pgsql-general
Hello all,

Couple things -- after unintentionally running a query for the (what feels like-) millionth time, it suggested a review of psql query editing behaviors. Starting with,

\r (clear 'query buffer'):  Other than dutifully reporting that the query buffer has been cleared, I cannot for the life of me detect any observable behavior.  If there is in fact one, the results are, with some forbearance, unintuitive.  Consider:
postgres=# \p
select 0;
postgres=# \r
Query buffer reset (cleared).
postgres=# \p
select 0;

Perhaps, it is reset, only to re-reset to last known prompt when prompt returned, but,
\r\e 
...claims to rest but the query buffer still contains the last executed command, which will then run with :q! in vim.

Regarding \e, things mostly work sanely, except that there is no way to not run a query except to explicitly write a blank buffer back, say with vim :wq after deleting all the lines in the buffer..  However, if you do so, the previously run query shows up again, for the next \e, which is odd.  Is this behavior intentional?  Is there something I'm missing?  Apologies if this has been discussed, cursory search did not turn up results, psql, query, buffer, etc not being selective terms.

merlin

В списке pgsql-general по дате отправления:

Предыдущее
От: Francisco Olarte
Дата:
Сообщение: Re: Very newbie question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: psql _ and \e -- what does clearing the query buffer actually do?