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

Commit5c5f835

Browse files
committed
Adjust pg_upgrade FATAL error messages to have consistent newlines.
Also adjust some error message capitalization for consistency.
1 parent3ef5b2d commit5c5f835

File tree

9 files changed

+20
-21
lines changed

9 files changed

+20
-21
lines changed

‎contrib/pg_upgrade/check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ check_cluster_compatibility(bool live_check)
253253

254254
if ((lib_test=fopen(libfile,"r"))==NULL)
255255
pg_log(PG_FATAL,
256-
"\npg_upgrade_support%s must be created and installed in %s\n",DLSUFFIX,libfile);
256+
"pg_upgrade_support%s must be created and installed in %s\n",DLSUFFIX,libfile);
257257
else
258258
fclose(lib_test);
259259

‎contrib/pg_upgrade/exec.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exec_prog(bool throw_error, const char *fmt,...)
4646
if (result!=0)
4747
{
4848
pg_log(throw_error ?PG_FATAL :PG_INFO,
49-
"\nThere were problems executing %s\n",cmd);
49+
"There were problems executing %s\n",cmd);
5050
return1;
5151
}
5252

@@ -71,7 +71,7 @@ is_server_running(const char *datadir)
7171
if ((fd=open(path,O_RDONLY,0))<0)
7272
{
7373
if (errno!=ENOENT)
74-
pg_log(PG_FATAL,"\ncould not open file \"%s\" for reading\n",
74+
pg_log(PG_FATAL,"could not open file \"%s\" for reading\n",
7575
path);
7676

7777
return false;
@@ -139,10 +139,10 @@ check_data_dir(const char *pg_data)
139139
requiredSubdirs[subdirnum]);
140140

141141
if (stat(subDirName,&statBuf)!=0)
142-
report_status(PG_FATAL,"check for %s failed: %s",
142+
report_status(PG_FATAL,"check for %s failed: %s\n",
143143
requiredSubdirs[subdirnum],getErrorText(errno));
144144
elseif (!S_ISDIR(statBuf.st_mode))
145-
report_status(PG_FATAL,"%s is not a directory",
145+
report_status(PG_FATAL,"%s is not a directory\n",
146146
requiredSubdirs[subdirnum]);
147147
}
148148
}

‎contrib/pg_upgrade/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ pg_scandir_internal(const char *dirname,
287287
size_tentrysize;
288288

289289
if ((dirdesc=opendir(dirname))==NULL)
290-
pg_log(PG_FATAL,"Could not open directory \"%s\": %m\n",dirname);
290+
pg_log(PG_FATAL,"could not open directory \"%s\": %m\n",dirname);
291291

292292
*namelist=NULL;
293293

‎contrib/pg_upgrade/option.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ parseCommandLine(int argc, char *argv[])
180180
*/
181181
/* truncate */
182182
if ((log_opts.fd=fopen(log_opts.filename,"w"))==NULL)
183-
pg_log(PG_FATAL,"Cannot write to log file %s\n",log_opts.filename);
183+
pg_log(PG_FATAL,"cannot write to log file %s\n",log_opts.filename);
184184
fclose(log_opts.fd);
185185
if ((log_opts.fd=fopen(log_opts.filename,"a"))==NULL)
186-
pg_log(PG_FATAL,"Cannot write to log file %s\n",log_opts.filename);
186+
pg_log(PG_FATAL,"cannot write to log file %s\n",log_opts.filename);
187187
}
188188
else
189189
log_opts.filename=strdup(DEVNULL);
@@ -193,7 +193,7 @@ parseCommandLine(int argc, char *argv[])
193193
{
194194
log_opts.debug_fd=fopen(DEVTTY,"w");
195195
if (!log_opts.debug_fd)
196-
pg_log(PG_FATAL,"Cannot write to terminal\n");
196+
pg_log(PG_FATAL,"cannot write to terminal\n");
197197
}
198198

199199
/* Get values from env if not already set */

‎contrib/pg_upgrade/pg_upgrade.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ copy_clog_xlog_xid(void)
302302
snprintf(old_clog_path,sizeof(old_clog_path),"%s/pg_clog",old_cluster.pgdata);
303303
snprintf(new_clog_path,sizeof(new_clog_path),"%s/pg_clog",new_cluster.pgdata);
304304
if (!rmtree(new_clog_path, true))
305-
pg_log(PG_FATAL,"Unable to delete directory %s\n",new_clog_path);
305+
pg_log(PG_FATAL,"unable to delete directory %s\n",new_clog_path);
306306
check_ok();
307307

308308
prep_status("Copying old commit clogs to new server");

‎contrib/pg_upgrade/server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ start_postmaster(ClusterInfo *cluster)
192192
if (conn)
193193
PQfinish(conn);
194194
pg_log(PG_FATAL,"unable to connect to %s postmaster started with the command: %s\n"
195-
"Perhaps pg_hba.conf was not set to \"trust\".",
195+
"Perhaps pg_hba.conf was not set to \"trust\".\n",
196196
CLUSTER_NAME(cluster),cmd);
197197
}
198198
PQfinish(conn);

‎contrib/pg_upgrade/util.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ report_status(eLogType type, const char *fmt,...)
4646
*if(( message = flarbFiles(fileCount)) == NULL)
4747
* report_status(PG_REPORT, "ok" );
4848
*else
49-
* pg_log(PG_FATAL, "failed - %s", message );
49+
* pg_log(PG_FATAL, "failed - %s\n", message );
5050
*/
5151
void
5252
prep_status(constchar*fmt,...)
@@ -97,8 +97,7 @@ pg_log(eLogType type, char *fmt,...)
9797
break;
9898

9999
casePG_FATAL:
100-
printf("%s","\n");
101-
printf("%s",_(message));
100+
printf("\n%s",_(message));
102101
printf("Failure, exiting\n");
103102
exit(1);
104103
break;

‎contrib/pg_upgrade/version.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster, bool check_mode)
4949
if (!check_mode)
5050
{
5151
if (script==NULL&& (script=fopen(output_path,"w"))==NULL)
52-
pg_log(PG_FATAL,"Could not create necessary file: %s\n",output_path);
52+
pg_log(PG_FATAL,"could not create necessary file: %s\n",output_path);
5353
fprintf(script,"\\connect %s\n",
5454
quote_identifier(active_db->db_name));
5555
fprintf(script,

‎contrib/pg_upgrade/version_old_8_3.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ old_8_3_check_for_name_data_type_usage(ClusterInfo *cluster)
7070
{
7171
found= true;
7272
if (script==NULL&& (script=fopen(output_path,"w"))==NULL)
73-
pg_log(PG_FATAL,"Could not create necessary file: %s\n",output_path);
73+
pg_log(PG_FATAL,"could not create necessary file: %s\n",output_path);
7474
if (!db_used)
7575
{
7676
fprintf(script,"Database: %s\n",active_db->db_name);
@@ -160,7 +160,7 @@ old_8_3_check_for_tsquery_usage(ClusterInfo *cluster)
160160
{
161161
found= true;
162162
if (script==NULL&& (script=fopen(output_path,"w"))==NULL)
163-
pg_log(PG_FATAL,"Could not create necessary file: %s\n",output_path);
163+
pg_log(PG_FATAL,"could not create necessary file: %s\n",output_path);
164164
if (!db_used)
165165
{
166166
fprintf(script,"Database: %s\n",active_db->db_name);
@@ -278,7 +278,7 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
278278
if (!check_mode)
279279
{
280280
if (script==NULL&& (script=fopen(output_path,"w"))==NULL)
281-
pg_log(PG_FATAL,"Could not create necessary file: %s\n",output_path);
281+
pg_log(PG_FATAL,"could not create necessary file: %s\n",output_path);
282282
if (!db_used)
283283
{
284284
fprintf(script,"\\connect %s\n\n",
@@ -398,7 +398,7 @@ old_8_3_invalidate_hash_gin_indexes(ClusterInfo *cluster, bool check_mode)
398398
if (!check_mode)
399399
{
400400
if (script==NULL&& (script=fopen(output_path,"w"))==NULL)
401-
pg_log(PG_FATAL,"Could not create necessary file: %s\n",output_path);
401+
pg_log(PG_FATAL,"could not create necessary file: %s\n",output_path);
402402
if (!db_used)
403403
{
404404
fprintf(script,"\\connect %s\n",
@@ -523,7 +523,7 @@ old_8_3_invalidate_bpchar_pattern_ops_indexes(ClusterInfo *cluster,
523523
if (!check_mode)
524524
{
525525
if (script==NULL&& (script=fopen(output_path,"w"))==NULL)
526-
pg_log(PG_FATAL,"Could not create necessary file: %s\n",output_path);
526+
pg_log(PG_FATAL,"could not create necessary file: %s\n",output_path);
527527
if (!db_used)
528528
{
529529
fprintf(script,"\\connect %s\n",
@@ -648,7 +648,7 @@ old_8_3_create_sequence_script(ClusterInfo *cluster)
648648
found= true;
649649

650650
if (script==NULL&& (script=fopen(output_path,"w"))==NULL)
651-
pg_log(PG_FATAL,"Could not create necessary file: %s\n",output_path);
651+
pg_log(PG_FATAL,"could not create necessary file: %s\n",output_path);
652652
if (!db_used)
653653
{
654654
fprintf(script,"\\connect %s\n\n",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp