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

Commit6197db5

Browse files
committed
Improve style of some replication-related error messages.
Put the remote end's error message into the primary error string,instead of relegating it to errdetail(). Although this could end upbeing awkward if the remote sends us a really long error message,it seems more in keeping with our message style guidelines, and morehelpful in situations where the errdetail could get dropped.Peter SmithDiscussion:https://postgr.es/m/CAHut+Ps-Qv2yQceCwobQDP0aJOkfDzRFrOaR6+2Op2K=WHGeWg@mail.gmail.com
1 parentdb973ff commit6197db5

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

‎src/backend/commands/subscriptioncmds.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,17 +1320,15 @@ ReplicationSlotDropAtPubNode(WalReceiverConn *wrconn, char *slotname, bool missi
13201320
{
13211321
/* LOG. Error, but missing_ok = true. */
13221322
ereport(LOG,
1323-
(errmsg("could not drop the replication slot \"%s\" on publisher",
1324-
slotname),
1325-
errdetail("The error was: %s",res->err)));
1323+
(errmsg("could not drop replication slot \"%s\" on publisher: %s",
1324+
slotname,res->err)));
13261325
}
13271326
else
13281327
{
13291328
/* ERROR. */
13301329
ereport(ERROR,
1331-
(errmsg("could not drop the replication slot \"%s\" on publisher",
1332-
slotname),
1333-
errdetail("The error was: %s",res->err)));
1330+
(errmsg("could not drop replication slot \"%s\" on publisher: %s",
1331+
slotname,res->err)));
13341332
}
13351333

13361334
walrcv_clear_result(res);
@@ -1545,8 +1543,7 @@ ReportSlotConnectionError(List *rstates, Oid subid, char *slotname, char *err)
15451543

15461544
ereport(ERROR,
15471545
(errmsg("could not connect to publisher when attempting to "
1548-
"drop the replication slot \"%s\"",slotname),
1549-
errdetail("The error was: %s",err),
1546+
"drop replication slot \"%s\": %s",slotname,err),
15501547
/* translator: %s is an SQL ALTER command */
15511548
errhint("Use %s to disassociate the subscription from the slot.",
15521549
"ALTER SUBSCRIPTION ... SET (slot_name = NONE)")));

‎src/backend/replication/logical/tablesync.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,8 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
10431043
0,NULL);
10441044
if (res->status!=WALRCV_OK_COMMAND)
10451045
ereport(ERROR,
1046-
(errmsg("table copy could not start transaction on publisher"),
1047-
errdetail("The error was: %s",res->err)));
1046+
(errmsg("table copy could not start transaction on publisher: %s",
1047+
res->err)));
10481048
walrcv_clear_result(res);
10491049

10501050
/*
@@ -1103,8 +1103,8 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
11031103
res=walrcv_exec(wrconn,"COMMIT",0,NULL);
11041104
if (res->status!=WALRCV_OK_COMMAND)
11051105
ereport(ERROR,
1106-
(errmsg("table copy could not finish transaction on publisher"),
1107-
errdetail("The error was: %s",res->err)));
1106+
(errmsg("table copy could not finish transaction on publisher: %s",
1107+
res->err)));
11081108
walrcv_clear_result(res);
11091109

11101110
table_close(rel,NoLock);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp