Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3639d08

Browse filesBrowse 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
Copy full SHA for 3639d08

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed

‎src/bin/pg_dump/filter.c

Copy file name to clipboardExpand all lines: src/bin/pg_dump/filter.c
+6-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.