Skip to content

Commit 3a7f545

Browse files
committed
fflush the \o file, if any, after each backslash command. We already
do this for ordinary SQL commands, so it seems consistent to do it for backslash commands too. Per gripe from Rajesh Kumar Mallah.
1 parent 36b8706 commit 3a7f545

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/bin/psql/command.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.175 2006/12/16 00:38:43 adunstan Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.176 2006/12/28 00:29:13 tgl Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "command.h"
@@ -60,8 +60,8 @@ static bool do_shell(const char *command);
6060
/*----------
6161
* HandleSlashCmds:
6262
*
63-
* Handles all the different commands that start with '\',
64-
* ordinarily called by MainLoop().
63+
* Handles all the different commands that start with '\'.
64+
* Ordinarily called by MainLoop().
6565
*
6666
* scan_state is a lexer working state that is set to continue scanning
6767
* just after the '\'. The lexer is advanced past the command and all
@@ -148,6 +148,9 @@ HandleSlashCmds(PsqlScanState scan_state,
148148

149149
free(cmd);
150150

151+
/* some commands write to queryFout, so make sure output is sent */
152+
fflush(pset.queryFout);
153+
151154
return status;
152155
}
153156

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy