Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux