diff options
Diffstat (limited to 'src/bin/psql/common.c')
-rw-r--r-- | src/bin/psql/common.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index 396a40089ce..621a33f7e83 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -707,13 +707,8 @@ PrintNotifications(void) static bool PrintQueryTuples(const PGresult *results) { - printQueryOpt my_popt = pset.popt; bool result = true; - /* one-shot expanded output requested via \gx */ - if (pset.g_expanded) - my_popt.topt.expanded = 1; - /* write output to \g argument, if any */ if (pset.gfname) { @@ -725,7 +720,7 @@ PrintQueryTuples(const PGresult *results) if (is_pipe) disable_sigpipe_trap(); - printQuery(results, &my_popt, fout, false, pset.logfile); + printQuery(results, &pset.popt, fout, false, pset.logfile); if (ferror(fout)) { pg_log_error("could not print result table: %m"); @@ -742,7 +737,7 @@ PrintQueryTuples(const PGresult *results) } else { - printQuery(results, &my_popt, pset.queryFout, false, pset.logfile); + printQuery(results, &pset.popt, pset.queryFout, false, pset.logfile); if (ferror(pset.queryFout)) { pg_log_error("could not print result table: %m"); @@ -1418,8 +1413,12 @@ sendquery_cleanup: pset.gfname = NULL; } - /* reset \gx's expanded-mode flag */ - pset.g_expanded = false; + /* restore print settings if \g changed them */ + if (pset.gsavepopt) + { + restorePsetInfo(&pset.popt, pset.gsavepopt); + pset.gsavepopt = NULL; + } /* reset \gset trigger */ if (pset.gset_prefix) @@ -1646,10 +1645,6 @@ ExecQueryUsingCursor(const char *query, double *elapsed_msec) "FETCH FORWARD %d FROM _psql_cursor", fetch_count); - /* one-shot expanded output requested via \gx */ - if (pset.g_expanded) - my_popt.topt.expanded = 1; - /* prepare to write output to \g argument, if any */ if (pset.gfname) { |