postgresql/src/bin
Tom Lane 07338cb742 Clean up some psql issues around handling of the query output file.
Formerly, if "psql -o foo" failed to open the output file "foo", it would
print an error message but then carry on as though -o had not been
specified at all.  This seems contrary to expectation: a program that
cannot open its output file normally fails altogether.  Make psql do
exit(1) after reporting the error.

If "\o foo" failed to open "foo", it would print an error message but then
reset the output file to stdout, as if the argument had been omitted.
This is likewise pretty surprising behavior.  Make it keep the previous
output state, instead.

psql keeps SIGPIPE interrupts disabled when it is writing to a pipe, either
a pipe specified by -o/\o or a transient pipe opened for purposes such as
using a pager on query output.  The logic for this was too simple and could
sometimes re-enable SIGPIPE when a -o pipe was still active, thus possibly
leading to an unexpected psql crash later.

Fixing the last point required getting rid of the kluge in PrintQueryTuples
and ExecQueryUsingCursor whereby they'd transiently change the global
queryFout state, but that seems like good cleanup anyway.

Back-patch to 9.5 but not further; these are minor-enough issues that
changing the behavior in stable branches doesn't seem appropriate.
2015-12-03 14:29:29 -05:00
..
initdb Translation updates 2015-10-05 11:01:07 -04:00
pg_archivecleanup Make WAL-related utilities handle .partial WAL files properly. 2015-07-03 11:54:44 +09:00
pg_basebackup Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:32 -05:00
pg_config Translation updates 2015-10-05 11:01:07 -04:00
pg_controldata Translation updates 2015-11-09 10:21:11 -05:00
pg_ctl Back-patch fixes to make TAP tests work on Windows. 2015-11-17 14:10:24 -05:00
pg_dump Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:32 -05:00
pg_resetxlog Translation updates 2015-11-09 10:21:11 -05:00
pg_rewind Back-patch fixes to make TAP tests work on Windows. 2015-11-17 14:10:24 -05:00
pg_test_fsync Move pg_test_fsync from contrib/ to src/bin/ 2015-04-19 22:20:49 -04:00
pg_test_timing Move pg_test_timing from contrib/ to src/bin/ 2015-04-20 21:30:12 -04:00
pg_upgrade pg_upgrade: fix CopyFile() on Windows to fail on file existence 2015-11-24 17:18:28 -05:00
pg_xlogdump Improve includes introduced in the replication origins patch. 2015-08-06 12:41:59 +02:00
pgbench Fix incorrect tps number calculation in "excluding connections establishing". 2015-09-30 10:36:23 +09:00
pgevent Update copyright for 2015 2015-01-06 11:43:47 -05:00
psql Clean up some psql issues around handling of the query output file. 2015-12-03 14:29:29 -05:00
scripts Fix behavior of printTable() and friends with externally-invoked pager. 2015-12-02 18:20:34 -05:00
Makefile Move pg_xlogdump from contrib/ to src/bin/ 2015-04-21 19:03:49 -04:00