diff options
author | Bruce Momjian <bruce@momjian.us> | 2009-12-01 22:34:33 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2009-12-01 22:34:33 +0000 |
commit | b291c0fba83a1e93868e2f69c03be195d620f30c (patch) | |
tree | a6dc9db3aece76869a20994fe0dad6ac302dccdf /src/bin/psql/command.c | |
parent | 0d32342501f2a562bc57156dc92d59a0624be4a6 (diff) | |
download | postgresql-b291c0fba83a1e93868e2f69c03be195d620f30c.tar.gz postgresql-b291c0fba83a1e93868e2f69c03be195d620f30c.zip |
psql -f -
Adjust psql -f - to behave like a normal file and honor the -1 flag.
Report from Robert Haas
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r-- | src/bin/psql/command.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 5a356b9b5ee..3f32f5d9d99 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.211 2009/11/22 05:20:41 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.212 2009/12/01 22:34:33 momjian Exp $ */ #include "postgres_fe.h" #include "command.h" @@ -1691,8 +1691,13 @@ process_file(char *filename, bool single_txn) if (!filename) return EXIT_FAILURE; - canonicalize_path(filename); - fd = fopen(filename, PG_BINARY_R); + if (strcmp(filename, "-") != 0) + { + canonicalize_path(filename); + fd = fopen(filename, PG_BINARY_R); + } + else + fd = stdin; if (!fd) { |