Skip to content

Commit 3639d08

Browse files
committed
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.
1 parent 16a3415 commit 3639d08

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/bin/pg_dump/filter.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,12 @@ pg_log_filter_error(FilterStateData *fstate, const char *fmt,...)
161161
vsnprintf(buf, sizeof(buf), fmt, argp);
162162
va_end(argp);
163163

164-
pg_log_error("invalid format in filter read from \"%s\" on line %d: %s",
165-
(fstate->fp == stdin ? "stdin" : fstate->filename),
166-
fstate->lineno,
167-
buf);
164+
if (fstate->fp == stdin)
165+
pg_log_error("invalid format in filter read from standard input on line %d: %s",
166+
fstate->lineno, buf);
167+
else
168+
pg_log_error("invalid format in filter read from file \"%s\" on line %d: %s",
169+
fstate->filename, fstate->lineno, buf);
168170
}
169171

170172
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy