Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitcd917ff

Browse files
committed
pg_upgrade: Improve error messages
Make wording more accurate and add strerror() information.Discussion:https://www.postgresql.org/message-id/24c8bd05-aed1-6301-919d-8acbabdb8c24@2ndquadrant.com
1 parentaba78ab commitcd917ff

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/bin/pg_upgrade/exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
146146
#endif
147147

148148
if (log==NULL)
149-
pg_fatal("could notwrite tolog file \"%s\"\n",log_file);
149+
pg_fatal("could notopenlog file \"%s\": %m\n",log_file);
150150

151151
#ifdefWIN32
152152
/* Are we printing "command:" before its output? */
@@ -201,7 +201,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
201201
* log these commands to a third file, but that just adds complexity.
202202
*/
203203
if ((log=fopen(log_file,"a"))==NULL)
204-
pg_fatal("could not write to log file \"%s\"\n",log_file);
204+
pg_fatal("could not write to log file \"%s\": %m\n",log_file);
205205
fprintf(log,"\n\n");
206206
fclose(log);
207207
#endif

‎src/bin/pg_upgrade/option.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ parseCommandLine(int argc, char *argv[])
217217
}
218218

219219
if ((log_opts.internal=fopen_priv(INTERNAL_LOG_FILE,"a"))==NULL)
220-
pg_fatal("could notwrite tolog file \"%s\"\n",INTERNAL_LOG_FILE);
220+
pg_fatal("could notopenlog file \"%s\": %m\n",INTERNAL_LOG_FILE);
221221

222222
if (log_opts.verbose)
223223
pg_log(PG_REPORT,"Running in verbose mode\n");
@@ -226,7 +226,7 @@ parseCommandLine(int argc, char *argv[])
226226
for (filename=output_files;*filename!=NULL;filename++)
227227
{
228228
if ((fp=fopen_priv(*filename,"a"))==NULL)
229-
pg_fatal("could not write to log file \"%s\"\n",*filename);
229+
pg_fatal("could not write to log file \"%s\": %m\n",*filename);
230230

231231
/* Start with newline because we might be appending to a file. */
232232
fprintf(fp,"\n"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp