Skip to content

Commit ba83213

Browse files
committed
Switch format specifier for replication origins to %d
Using %u with uint16 causes warnings with -Wformat-signedness. There are many other warnings, but for now change only these since c920fe4 already changed the message string for most of them. Per report from Peter Eisentraut Discussion: https://www.postgresql.org/message-id/31e63649-0355-7088-831e-b07d5f908a8c%40enterprisedb.com
1 parent 1b9050d commit ba83213

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/backend/replication/logical/origin.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ replorigin_drop_guts(Relation rel, RepOriginId roident, bool nowait)
364364
if (nowait)
365365
ereport(ERROR,
366366
(errcode(ERRCODE_OBJECT_IN_USE),
367-
errmsg("could not drop replication origin with ID %u, in use by PID %d",
367+
errmsg("could not drop replication origin with ID %d, in use by PID %d",
368368
state->roident,
369369
state->acquired_by)));
370370

@@ -408,7 +408,7 @@ replorigin_drop_guts(Relation rel, RepOriginId roident, bool nowait)
408408
*/
409409
tuple = SearchSysCache1(REPLORIGIDENT, ObjectIdGetDatum(roident));
410410
if (!HeapTupleIsValid(tuple))
411-
elog(ERROR, "cache lookup failed for replication origin with ID %u",
411+
elog(ERROR, "cache lookup failed for replication origin with ID %d",
412412
roident);
413413

414414
CatalogTupleDelete(rel, &tuple->t_self);
@@ -485,7 +485,7 @@ replorigin_by_oid(RepOriginId roident, bool missing_ok, char **roname)
485485
if (!missing_ok)
486486
ereport(ERROR,
487487
(errcode(ERRCODE_UNDEFINED_OBJECT),
488-
errmsg("replication origin with ID %u does not exist",
488+
errmsg("replication origin with ID %d does not exist",
489489
roident)));
490490

491491
return false;
@@ -799,7 +799,7 @@ StartupReplicationOrigin(void)
799799
last_state++;
800800

801801
ereport(LOG,
802-
(errmsg("recovered replication state of node %u to %X/%X",
802+
(errmsg("recovered replication state of node %d to %X/%X",
803803
disk_state.roident,
804804
LSN_FORMAT_ARGS(disk_state.remote_lsn))));
805805
}
@@ -937,7 +937,7 @@ replorigin_advance(RepOriginId node,
937937
{
938938
ereport(ERROR,
939939
(errcode(ERRCODE_OBJECT_IN_USE),
940-
errmsg("replication origin with ID %u is already active for PID %d",
940+
errmsg("replication origin with ID %d is already active for PID %d",
941941
replication_state->roident,
942942
replication_state->acquired_by)));
943943
}
@@ -948,7 +948,7 @@ replorigin_advance(RepOriginId node,
948948
if (replication_state == NULL && free_state == NULL)
949949
ereport(ERROR,
950950
(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
951-
errmsg("could not find free replication state slot for replication origin with ID %u",
951+
errmsg("could not find free replication state slot for replication origin with ID %d",
952952
node),
953953
errhint("Increase max_replication_slots and try again.")));
954954

@@ -1126,7 +1126,7 @@ replorigin_session_setup(RepOriginId node)
11261126
{
11271127
ereport(ERROR,
11281128
(errcode(ERRCODE_OBJECT_IN_USE),
1129-
errmsg("replication origin with ID %u is already active for PID %d",
1129+
errmsg("replication origin with ID %d is already active for PID %d",
11301130
curstate->roident, curstate->acquired_by)));
11311131
}
11321132

@@ -1138,7 +1138,7 @@ replorigin_session_setup(RepOriginId node)
11381138
if (session_replication_state == NULL && free_slot == -1)
11391139
ereport(ERROR,
11401140
(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
1141-
errmsg("could not find free replication state slot for replication origin with ID %u",
1141+
errmsg("could not find free replication state slot for replication origin with ID %d",
11421142
node),
11431143
errhint("Increase max_replication_slots and try again.")));
11441144
else if (session_replication_state == NULL)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy