Skip to content

Commit ad48256

Browse files
committed
Fix documentation of psql's ECHO all mode.
"ECHO all" is ignored for interactive input, and has been for a very long time, though possibly not for as long as the documentation has claimed the opposite. Fix that, and also note that empty lines aren't echoed, which while dubious is another longstanding behavior (it's embedded in our regression test files for one thing). Per bug #12721 from Hans Ginzel. In HEAD, also improve the code comments in this area, and suppress an unnecessary fflush(stdout) when we're not echoing. That would likely be safe to back-patch, but I'll not risk it mere hours before a release wrap.
1 parent c9048d3 commit ad48256

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/src/sgml/ref/psql-ref.sgml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ PostgreSQL documentation
5353
<term><option>--echo-all</></term>
5454
<listitem>
5555
<para>
56-
Print all input lines to standard output as they are read. This is more
57-
useful for script processing than interactive mode. This is
56+
Print all nonempty input lines to standard output as they are read.
57+
(This does not apply to lines read interactively.) This is
5858
equivalent to setting the variable <varname>ECHO</varname> to
5959
<literal>all</literal>.
6060
</para>
@@ -2703,13 +2703,13 @@ bar
27032703
<term><varname>ECHO</varname></term>
27042704
<listitem>
27052705
<para>
2706-
If set to <literal>all</literal>, all lines
2707-
entered from the keyboard or from a script are written to the standard output
2708-
before they are parsed or executed. To select this behavior on program
2706+
If set to <literal>all</literal>, all nonempty input lines are printed
2707+
to standard output as they are read. (This does not apply to lines
2708+
read interactively.) To select this behavior on program
27092709
start-up, use the switch <option>-a</option>. If set to
27102710
<literal>queries</literal>,
2711-
<application>psql</application> merely prints all queries as
2712-
they are sent to the server. The switch for this is
2711+
<application>psql</application> prints each query to standard output
2712+
as it is sent to the server. The switch for this is
27132713
<option>-e</option>.
27142714
</para>
27152715
</listitem>

0 commit comments

Comments
 (0)