summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane2019-11-22 22:07:54 +0000
committerTom Lane2019-11-22 22:07:54 +0000
commitd1c866e57f1156000a51ff7e26590984d32bab53 (patch)
tree44391a289b8e061f3a83ee4e9b81b574e770fe50 /doc/src
parent73b06cf893c9d3bb38c11878a12cc29407e78b6c (diff)
Make psql redisplay the query buffer after \e.
Up to now, whatever you'd edited was put back into the query buffer but not redisplayed, which is less than user-friendly. But we can improve that just by printing the text along with a prompt, if we enforce that the editing result ends with a newline (which it typically would anyway). You then continue typing more lines if you want, or you can type ";" or do \g or \r or another \e. This is intentionally divorced from readline's processing, for simplicity and so that it works the same with or without readline enabled. We discussed possibly integrating things more closely with readline; but that seems difficult, uncertainly portable across different readline and libedit versions, and of limited real benefit anyway. Let's try the simple way and see if it's good enough. Patch by me, thanks to Fabien Coelho and Laurenz Albe for review Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/psql-ref.sgml16
1 files changed, 11 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index a55ca6a2666..48b081fd58a 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1831,9 +1831,13 @@ testdb=>
the normal rules of <application>psql</application>, treating the
whole buffer as a single line. Any complete queries are immediately
executed; that is, if the query buffer contains or ends with a
- semicolon, everything up to that point is executed. Whatever remains
- will wait in the query buffer; type semicolon or <literal>\g</literal> to
- send it, or <literal>\r</literal> to cancel it by clearing the query buffer.
+ semicolon, everything up to that point is executed and removed from
+ the query buffer. Whatever remains in the query buffer is
+ redisplayed. Type semicolon or <literal>\g</literal> to send it,
+ or <literal>\r</literal> to cancel it by clearing the query buffer.
+ </para>
+
+ <para>
Treating the buffer as a single line primarily affects meta-commands:
whatever is in the buffer after a meta-command will be taken as
argument(s) to the meta-command, even if it spans multiple lines.
@@ -1893,7 +1897,8 @@ Tue Oct 26 21:40:57 CEST 1999
in the form of a <command>CREATE OR REPLACE FUNCTION</command> or
<command>CREATE OR REPLACE PROCEDURE</command> command.
Editing is done in the same way as for <literal>\edit</literal>.
- After the editor exits, the updated command waits in the query buffer;
+ After the editor exits, the updated command is executed immediately
+ if you added a semicolon to it. Otherwise it is redisplayed;
type semicolon or <literal>\g</literal> to send it, or <literal>\r</literal>
to cancel.
</para>
@@ -1969,7 +1974,8 @@ Tue Oct 26 21:40:57 CEST 1999
This command fetches and edits the definition of the named view,
in the form of a <command>CREATE OR REPLACE VIEW</command> command.
Editing is done in the same way as for <literal>\edit</literal>.
- After the editor exits, the updated command waits in the query buffer;
+ After the editor exits, the updated command is executed immediately
+ if you added a semicolon to it. Otherwise it is redisplayed;
type semicolon or <literal>\g</literal> to send it, or <literal>\r</literal>
to cancel.
</para>