diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-06-20 11:36:38 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-06-20 11:36:38 +0200 |
commit | 3639d08e2f36f76e9a626c60b534c7fe204f329c (patch) | |
tree | 464b89db6d89630ccaeb2ea0111b69e9a31286d8 | |
parent | 16a3415440ecf2f5cd02848fc05cbfe040ce14c2 (diff) | |
download | postgresql-3639d08e2f36f76e9a626c60b534c7fe204f329c.tar.gz postgresql-3639d08e2f36f76e9a626c60b534c7fe204f329c.zip |
pg_dump: Fix weird error message composition
The previous way could make it look like "stdin" was the actual input
file name. Write it as two separate messages instead.
-rw-r--r-- | src/bin/pg_dump/filter.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bin/pg_dump/filter.c b/src/bin/pg_dump/filter.c index 3fb93c5f155..5815cd23748 100644 --- a/src/bin/pg_dump/filter.c +++ b/src/bin/pg_dump/filter.c @@ -161,10 +161,12 @@ pg_log_filter_error(FilterStateData *fstate, const char *fmt,...) vsnprintf(buf, sizeof(buf), fmt, argp); va_end(argp); - pg_log_error("invalid format in filter read from \"%s\" on line %d: %s", - (fstate->fp == stdin ? "stdin" : fstate->filename), - fstate->lineno, - buf); + if (fstate->fp == stdin) + pg_log_error("invalid format in filter read from standard input on line %d: %s", + fstate->lineno, buf); + else + pg_log_error("invalid format in filter read from file \"%s\" on line %d: %s", + fstate->filename, fstate->lineno, buf); } /* |