diff options
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r-- | src/bin/psql/command.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index a81bd3307b4..61188d96f2a 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -2661,6 +2661,7 @@ exec_command_write(PsqlScanState scan_state, bool active_branch, if (fname[0] == '|') { is_pipe = true; + fflush(NULL); disable_sigpipe_trap(); fd = popen(&fname[1], "w"); } @@ -3834,6 +3835,7 @@ editFile(const char *fname, int lineno) sys = psprintf("\"%s\" \"%s\"", editorName, fname); #endif + fflush(NULL); result = system(sys); if (result == -1) pg_log_error("could not start editor \"%s\"", editorName); @@ -4956,6 +4958,7 @@ do_shell(const char *command) { int result; + fflush(NULL); if (!command) { char *sys; @@ -5065,6 +5068,7 @@ do_watch(PQExpBuffer query_buf, double sleep) #endif if (pagerprog && myopt.topt.pager) { + fflush(NULL); disable_sigpipe_trap(); pagerpipe = popen(pagerprog, "w"); |