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

Commit 7cadaac

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 522ae01 commit 7cadaac

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

doc/src/sgml/replication-origins.sgml

Lines changed: 2 additions & 2 deletions
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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ replorigin_create(const char *roname)
316316
if (tuple == NULL)
317317
ereport(ERROR,
318318
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
319-
errmsg("could not find free replication origin OID")));
319+
errmsg("could not find free replication origin ID")));
320320

321321
heap_freetuple(tuple);
322322
return roident;
@@ -352,7 +352,7 @@ replorigin_drop_guts(Relation rel, RepOriginId roident, bool nowait)
352352
if (nowait)
353353
ereport(ERROR,
354354
(errcode(ERRCODE_OBJECT_IN_USE),
355-
errmsg("could not drop replication origin with OID %d, in use by PID %d",
355+
errmsg("could not drop replication origin with ID %u, in use by PID %d",
356356
state->roident,
357357
state->acquired_by)));
358358

@@ -396,7 +396,7 @@ replorigin_drop_guts(Relation rel, RepOriginId roident, bool nowait)
396396
*/
397397
tuple = SearchSysCache1(REPLORIGIDENT, ObjectIdGetDatum(roident));
398398
if (!HeapTupleIsValid(tuple))
399-
elog(ERROR, "cache lookup failed for replication origin with oid %u",
399+
elog(ERROR, "cache lookup failed for replication origin with ID %u",
400400
roident);
401401

402402
CatalogTupleDelete(rel, &tuple->t_self);
@@ -473,7 +473,7 @@ replorigin_by_oid(RepOriginId roident, bool missing_ok, char **roname)
473473
if (!missing_ok)
474474
ereport(ERROR,
475475
(errcode(ERRCODE_UNDEFINED_OBJECT),
476-
errmsg("replication origin with OID %u does not exist",
476+
errmsg("replication origin with ID %u does not exist",
477477
roident)));
478478

479479
return false;
@@ -925,7 +925,7 @@ replorigin_advance(RepOriginId node,
925925
{
926926
ereport(ERROR,
927927
(errcode(ERRCODE_OBJECT_IN_USE),
928-
errmsg("replication origin with OID %d is already active for PID %d",
928+
errmsg("replication origin with ID %u is already active for PID %d",
929929
replication_state->roident,
930930
replication_state->acquired_by)));
931931
}
@@ -936,7 +936,7 @@ replorigin_advance(RepOriginId node,
936936
if (replication_state == NULL && free_state == NULL)
937937
ereport(ERROR,
938938
(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
939-
errmsg("could not find free replication state slot for replication origin with OID %u",
939+
errmsg("could not find free replication state slot for replication origin with ID %u",
940940
node),
941941
errhint("Increase max_replication_slots and try again.")));
942942

@@ -1114,7 +1114,7 @@ replorigin_session_setup(RepOriginId node)
11141114
{
11151115
ereport(ERROR,
11161116
(errcode(ERRCODE_OBJECT_IN_USE),
1117-
errmsg("replication origin with OID %d is already active for PID %d",
1117+
errmsg("replication origin with ID %u is already active for PID %d",
11181118
curstate->roident, curstate->acquired_by)));
11191119
}
11201120

@@ -1126,7 +1126,7 @@ replorigin_session_setup(RepOriginId node)
11261126
if (session_replication_state == NULL && free_slot == -1)
11271127
ereport(ERROR,
11281128
(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
1129-
errmsg("could not find free replication state slot for replication origin with OID %u",
1129+
errmsg("could not find free replication state slot for replication origin with ID %u",
11301130
node),
11311131
errhint("Increase max_replication_slots and try again.")));
11321132
else if (session_replication_state == NULL)

0 commit comments

Comments
 (0)