Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+6-4
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)