mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
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.
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user