From be690e291d59e8d0c9f4df59abe09f1ff6cc0da9 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 9 Aug 2012 09:59:45 -0400 Subject: Make psql -1 < file behave as expected. Previously, the -1 option was silently ignored. Also, emit an error if -1 is used in a context where it won't be respected, to avoid user confusion. Original patch by Fabien COELHO, but this version is quite different from the original submission. --- src/bin/psql/command.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/bin/psql/command.c') diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 8abadb26c49..6ead800aeb1 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -2043,9 +2043,11 @@ process_file(char *filename, bool single_txn, bool use_relative_path) PGresult *res; if (!filename) - return EXIT_FAILURE; - - if (strcmp(filename, "-") != 0) + { + fd = stdin; + filename = NULL; + } + else if (strcmp(filename, "-") != 0) { canonicalize_path(filename); -- cgit v1.2.3