Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c920fe4

Browse files
committed
Refer to replication origin roident as "ID" in user facing messages and docs
The table column that stores this is of type oid, but is actually limited to uint16 and has a different path for creating new values. Some of the documentation already referred to it as an ID, so let's standardize on that. While at it, most format strings already use %u, so for consintency change the remaining stragglers using %d. Per suggestions from Tom Lane and Justin Pryzby Discussion: https://www.postgresql.org/message-id/3437166.1659620465%40sss.pgh.pa.us Backpatch to v15
1 parent af7d270 commit c920fe4

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

doc/src/sgml/replication-origins.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
</para>
2828

2929
<para>
30-
Replication origins have just two properties, a name and an OID. The name,
30+
Replication origins have just two properties, a name and an ID. The name,
3131
which is what should be used to refer to the origin across systems, is
3232
free-form <type>text</type>. It should be used in a way that makes conflicts
3333
between replication origins created by different replication solutions
3434
unlikely; e.g., by prefixing the replication solution's name to it.
35-
The OID is used only to avoid having to store the long version
35+
The ID is used only to avoid having to store the long version
3636
in situations where space efficiency is important. It should never be shared
3737
across systems.
3838
</para>

src/backend/replication/logical/origin.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ replorigin_create(const char *roname)
328328
if (tuple == NULL)
329329
ereport(ERROR,
330330
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
331-
errmsg("could not find free replication origin OID")));
331+
errmsg("could not find free replication origin ID")));
332332

333333
heap_freetuple(tuple);
334334
return roident;
@@ -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 OID %d, in use by PID %d",
367+
errmsg("could not drop replication origin with ID %u, 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 oid %u",
411+
elog(ERROR, "cache lookup failed for replication origin with ID %u",
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 OID %u does not exist",
488+
errmsg("replication origin with ID %u does not exist",
489489
roident)));
490490

491491
return false;
@@ -937,7 +937,7 @@ replorigin_advance(RepOriginId node,
937937
{
938938
ereport(ERROR,
939939
(errcode(ERRCODE_OBJECT_IN_USE),
940-
errmsg("replication origin with OID %d is already active for PID %d",
940+
errmsg("replication origin with ID %u 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 OID %u",
951+
errmsg("could not find free replication state slot for replication origin with ID %u",
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 OID %d is already active for PID %d",
1129+
errmsg("replication origin with ID %u 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 OID %u",
1141+
errmsg("could not find free replication state slot for replication origin with ID %u",
11421142
node),
11431143
errhint("Increase max_replication_slots and try again.")));
11441144
else if (session_replication_state == NULL)

0 commit comments

Comments
 (0)