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

Commite852c5d

Browse files
committed
pg_dump: Formatting cleanup of new messages
1 parent886c05d commite852c5d

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

‎src/bin/pg_dump/parallel.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ init_parallel_dump_utils(void)
140140
err=WSAStartup(MAKEWORD(2,2),&wsaData);
141141
if (err!=0)
142142
{
143-
fprintf(stderr,_("WSAStartup failed: %d\n"),err);
143+
fprintf(stderr,_("%s:WSAStartup failed: %d\n"),progname,err);
144144
exit_nicely(1);
145145
}
146146
on_exit_nicely(shutdown_parallel_dump_utils,NULL);
@@ -532,7 +532,7 @@ ParallelBackupStart(ArchiveHandle *AH, RestoreOptions *ropt)
532532

533533
if (pgpipe(pipeMW)<0||pgpipe(pipeWM)<0)
534534
exit_horribly(modulename,
535-
"Cannot create communication channels: %s\n",
535+
"could not create communication channels: %s\n",
536536
strerror(errno));
537537

538538
pstate->parallelSlot[i].workerStatus=WRKR_IDLE;
@@ -819,7 +819,7 @@ lockTableNoWait(ArchiveHandle *AH, TocEntry *te)
819819

820820
if (!res||PQresultStatus(res)!=PGRES_TUPLES_OK)
821821
exit_horribly(modulename,
822-
"could not get relation name foroid %d: %s\n",
822+
"could not get relation name forOID %u: %s\n",
823823
te->catalogId.oid,PQerrorMessage(AH->connection));
824824

825825
resetPQExpBuffer(query);
@@ -836,9 +836,9 @@ lockTableNoWait(ArchiveHandle *AH, TocEntry *te)
836836

837837
if (!res||PQresultStatus(res)!=PGRES_COMMAND_OK)
838838
exit_horribly(modulename,
839-
"could not obtain lock on relation \"%s\". This"
840-
"usually means that someone requested an ACCESS EXCLUSIVE lock "
841-
"on the table after the pg_dump parent processhas gotten the "
839+
"could not obtain lock on relation \"%s\"\n"
840+
"Thisusually means that someone requested an ACCESS EXCLUSIVE lock "
841+
"on the table after the pg_dump parent processhad gotten the "
842842
"initial ACCESS SHARE lock on the table.\n",qualId);
843843

844844
PQclear(res);
@@ -920,7 +920,7 @@ WaitForCommands(ArchiveHandle *AH, int pipefd[2])
920920
}
921921
else
922922
exit_horribly(modulename,
923-
"Unknown command on communication channel: %s\n",
923+
"unrecognized command on communication channel: %s\n",
924924
command);
925925
}
926926
}
@@ -950,7 +950,7 @@ ListenToWorkers(ArchiveHandle *AH, ParallelState *pstate, bool do_wait)
950950
if (!msg)
951951
{
952952
if (do_wait)
953-
exit_horribly(modulename,"A worker process died unexpectedly\n");
953+
exit_horribly(modulename,"a worker process died unexpectedly\n");
954954
return;
955955
}
956956

@@ -977,7 +977,7 @@ ListenToWorkers(ArchiveHandle *AH, ParallelState *pstate, bool do_wait)
977977
}
978978
else
979979
exit_horribly(modulename,
980-
"Invalid message received from worker: %s\n",msg);
980+
"invalid message received from worker: %s\n",msg);
981981
}
982982
elseif (messageStartsWith(msg,"ERROR "))
983983
{
@@ -986,7 +986,7 @@ ListenToWorkers(ArchiveHandle *AH, ParallelState *pstate, bool do_wait)
986986
exit_horribly(modulename,"%s",msg+strlen("ERROR "));
987987
}
988988
else
989-
exit_horribly(modulename,"Invalid message received from worker: %s\n",msg);
989+
exit_horribly(modulename,"invalid message received from worker: %s\n",msg);
990990

991991
/* both Unix and Win32 return pg_malloc()ed space, so we free it */
992992
free(msg);
@@ -1035,7 +1035,7 @@ EnsureIdleWorker(ArchiveHandle *AH, ParallelState *pstate)
10351035
while ((ret_worker=ReapWorkerStatus(pstate,&work_status))!=NO_SLOT)
10361036
{
10371037
if (work_status!=0)
1038-
exit_horribly(modulename,"Error processing a parallel work item.\n");
1038+
exit_horribly(modulename,"error processing a parallel work item\n");
10391039

10401040
nTerm++;
10411041
}
@@ -1079,7 +1079,7 @@ EnsureWorkersFinished(ArchiveHandle *AH, ParallelState *pstate)
10791079
ListenToWorkers(AH,pstate, true);
10801080
elseif (work_status!=0)
10811081
exit_horribly(modulename,
1082-
"Error processing a parallel work item\n");
1082+
"error processing a parallel work item\n");
10831083
}
10841084
}
10851085

@@ -1107,7 +1107,7 @@ sendMessageToMaster(int pipefd[2], const char *str)
11071107

11081108
if (pipewrite(pipefd[PIPE_WRITE],str,len)!=len)
11091109
exit_horribly(modulename,
1110-
"Error writing to the communication channel: %s\n",
1110+
"could not write to the communication channel: %s\n",
11111111
strerror(errno));
11121112
}
11131113

@@ -1208,7 +1208,7 @@ getMessageFromWorker(ParallelState *pstate, bool do_wait, int *worker)
12081208
}
12091209

12101210
if (i<0)
1211-
exit_horribly(modulename,"Error in ListenToWorkers(): %s",strerror(errno));
1211+
exit_horribly(modulename,"error in ListenToWorkers(): %s\n",strerror(errno));
12121212

12131213
for (i=0;i<pstate->numWorkers;i++)
12141214
{
@@ -1245,7 +1245,7 @@ sendMessageToWorker(ParallelState *pstate, int worker, const char *str)
12451245
if (!aborting)
12461246
#endif
12471247
exit_horribly(modulename,
1248-
"Error writing to the communication channel: %s\n",
1248+
"could not write to the communication channel: %s\n",
12491249
strerror(errno));
12501250
}
12511251
}
@@ -1319,7 +1319,7 @@ pgpipe(int handles[2])
13191319

13201320
if ((s=socket(AF_INET,SOCK_STREAM,0))==INVALID_SOCKET)
13211321
{
1322-
write_msg(modulename,"pgpipe could not create socket:%ui",
1322+
write_msg(modulename,"pgpipe: could not create socket:error code %d\n",
13231323
WSAGetLastError());
13241324
return-1;
13251325
}
@@ -1330,43 +1330,43 @@ pgpipe(int handles[2])
13301330
serv_addr.sin_addr.s_addr=htonl(INADDR_LOOPBACK);
13311331
if (bind(s, (SOCKADDR*)&serv_addr,len)==SOCKET_ERROR)
13321332
{
1333-
write_msg(modulename,"pgpipe could not bind:%ui",
1333+
write_msg(modulename,"pgpipe: could not bind:error code %d\n",
13341334
WSAGetLastError());
13351335
closesocket(s);
13361336
return-1;
13371337
}
13381338
if (listen(s,1)==SOCKET_ERROR)
13391339
{
1340-
write_msg(modulename,"pgpipe could not listen:%ui",
1340+
write_msg(modulename,"pgpipe: could not listen:error code %d\n",
13411341
WSAGetLastError());
13421342
closesocket(s);
13431343
return-1;
13441344
}
13451345
if (getsockname(s, (SOCKADDR*)&serv_addr,&len)==SOCKET_ERROR)
13461346
{
1347-
write_msg(modulename,"pgpipe could notgetsockname: %ui",
1347+
write_msg(modulename,"pgpipe:getsockname() failed: error code %d\n",
13481348
WSAGetLastError());
13491349
closesocket(s);
13501350
return-1;
13511351
}
13521352
if ((handles[1]=socket(PF_INET,SOCK_STREAM,0))==INVALID_SOCKET)
13531353
{
1354-
write_msg(modulename,"pgpipe could not createsocket 2: %ui",
1354+
write_msg(modulename,"pgpipe: could not createsecond socket: error code %d\n",
13551355
WSAGetLastError());
13561356
closesocket(s);
13571357
return-1;
13581358
}
13591359

13601360
if (connect(handles[1], (SOCKADDR*)&serv_addr,len)==SOCKET_ERROR)
13611361
{
1362-
write_msg(modulename,"pgpipe could not connect socket:%ui",
1362+
write_msg(modulename,"pgpipe: could not connect socket:error code %d\n",
13631363
WSAGetLastError());
13641364
closesocket(s);
13651365
return-1;
13661366
}
13671367
if ((handles[0]=accept(s, (SOCKADDR*)&serv_addr,&len))==INVALID_SOCKET)
13681368
{
1369-
write_msg(modulename,"pgpipe could not acceptsocket: %ui",
1369+
write_msg(modulename,"pgpipe: could not acceptconnection: error code %d\n",
13701370
WSAGetLastError());
13711371
closesocket(handles[1]);
13721372
handles[1]=INVALID_SOCKET;

‎src/bin/pg_dump/pg_backup_directory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ _WorkerJobDumpDirectory(ArchiveHandle *AH, TocEntry *te)
797797

798798
/* This should never happen */
799799
if (!tctx)
800-
exit_horribly(modulename,"Error during backup\n");
800+
exit_horribly(modulename,"error during backup\n");
801801

802802
/*
803803
* This function returns void. We either fail and die horribly or

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp