pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix gratuitous error message variation
9+ messages / 4 participants
[nested] [flat]

* pgsql: Fix gratuitous error message variation
@ 2019-11-08 17:40 Peter Eisentraut <peter@eisentraut.org>
  2019-11-09 01:20 ` Re: pgsql: Fix gratuitous error message variation Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Peter Eisentraut @ 2019-11-08 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix gratuitous error message variation

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3dcffb381c81c9c8f8254100feacac256b9e75a6

Modified Files
--------------
src/backend/replication/logical/origin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Fix gratuitous error message variation
  2019-11-08 17:40 pgsql: Fix gratuitous error message variation Peter Eisentraut <peter@eisentraut.org>
@ 2019-11-09 01:20 ` Tom Lane <tgl@sss.pgh.pa.us>
  2019-11-09 08:01   ` Re: pgsql: Fix gratuitous error message variation Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2019-11-09 01:20 UTC (permalink / raw)
  To: Peter Eisentraut <peter@eisentraut.org>; +Cc: pgsql-committers@lists.postgresql.org

Peter Eisentraut <peter@eisentraut.org> writes:
> Fix gratuitous error message variation

Hm, as long as you're touching that ... OIDs should be formatted
with %u not %d.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Fix gratuitous error message variation
  2019-11-08 17:40 pgsql: Fix gratuitous error message variation Peter Eisentraut <peter@eisentraut.org>
  2019-11-09 01:20 ` Re: pgsql: Fix gratuitous error message variation Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-11-09 08:01   ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  2019-11-09 13:13     ` Re: pgsql: Fix gratuitous error message variation Euler Taveira <euler@timbira.com.br>
  0 siblings, 1 reply; 9+ messages in thread

From: Peter Eisentraut @ 2019-11-09 08:01 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

On 2019-11-09 02:20, Tom Lane wrote:
> Peter Eisentraut <peter@eisentraut.org> writes:
>> Fix gratuitous error message variation
> 
> Hm, as long as you're touching that ... OIDs should be formatted
> with %u not %d.

This is just a fixup of the recent patch 
8f75e8e44609335e6bdd73123284682235f242a2.

Replication origin IDs are actually

typedef uint16 RepOriginId;

so using the term OID is probably wrong altogether.  I'm not sure what 
the overall intent was here.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pgsql: Fix gratuitous error message variation
  2019-11-08 17:40 pgsql: Fix gratuitous error message variation Peter Eisentraut <peter@eisentraut.org>
  2019-11-09 01:20 ` Re: pgsql: Fix gratuitous error message variation Tom Lane <tgl@sss.pgh.pa.us>
  2019-11-09 08:01   ` Re: pgsql: Fix gratuitous error message variation Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
@ 2019-11-09 13:13     ` Euler Taveira <euler@timbira.com.br>
  0 siblings, 0 replies; 9+ messages in thread

From: Euler Taveira @ 2019-11-09 13:13 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-committers@lists.postgresql.org

Em sáb., 9 de nov. de 2019 às 05:02, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> escreveu:
>
> On 2019-11-09 02:20, Tom Lane wrote:
> > Peter Eisentraut <peter@eisentraut.org> writes:
> >> Fix gratuitous error message variation
> >
> > Hm, as long as you're touching that ... OIDs should be formatted
> > with %u not %d.
>
> This is just a fixup of the recent patch
> 8f75e8e44609335e6bdd73123284682235f242a2.
>
> Replication origin IDs are actually
>
> typedef uint16 RepOriginId;
>
... that is different from OIDs.

> so using the term OID is probably wrong altogether.  I'm not sure what
> the overall intent was here.
>
According to the following comment:

     * We need the numeric replication origin to be 16bit wide, so we cannot
     * rely on the normal oid allocation. Instead we simply scan
     * pg_replication_origin for the first unused id. That's not particularly
     * efficient, but this should be a fairly infrequent operation - we can
     * easily spend a bit more code on this when it turns out it needs to be
     * faster.

... it seems the author wants to use OID infrastructure for a type
(RepOriginId) that is similar to Oid.

Although, it is a different representation from OID, it uses OID
infrastructure in its API. Indeed RepOriginId is a subset of Oid. If
terminology "replication origin OID" is used, users can complain that
it will fail to allocate more than 65k replication origins (OID range
is much larger).Frankly, I don't foresee it happen in decades. I think
"replication origin" shouldn't use OID datatype, however, that ship
has sailed. I propose to use %u instead of %d (same as we do with
OIDs). I also included a s/oid/OID/. Patch is attached.


-- 
   Euler Taveira                                   Timbira -
http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

Attachments:

repl-origin.diff (text/x-patch, 1.6K) download diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c index fad2194418..8af20a4496 100644 --- a/src/backend/replication/logical/origin.c +++ b/src/backend/replication/logical/origin.c @@ -367,7 +367,7 @@ restart: if (nowait) ereport(ERROR, (errcode(ERRCODE_OBJECT_IN_USE), - errmsg("could not drop replication origin with OID %d, in use by PID %d", + errmsg("could not drop replication origin with OID %u, in use by PID %d", state->roident, state->acquired_by))); @@ -411,7 +411,7 @@ restart: */ tuple = SearchSysCache1(REPLORIGIDENT, ObjectIdGetDatum(roident)); if (!HeapTupleIsValid(tuple)) - elog(ERROR, "cache lookup failed for replication origin with oid %u", + elog(ERROR, "cache lookup failed for replication origin with OID %u", roident); CatalogTupleDelete(rel, &tuple->t_self); @@ -914,7 +914,7 @@ replorigin_advance(RepOriginId node, { ereport(ERROR, (errcode(ERRCODE_OBJECT_IN_USE), - errmsg("replication origin with OID %d is already active for PID %d", + errmsg("replication origin with OID %u is already active for PID %d", replication_state->roident, replication_state->acquired_by))); } @@ -1100,7 +1100,7 @@ replorigin_session_setup(RepOriginId node) { ereport(ERROR, (errcode(ERRCODE_OBJECT_IN_USE), - errmsg("replication origin with OID %d is already active for PID %d", + errmsg("replication origin with OID %u is already active for PID %d", curstate->roident, curstate->acquired_by))); }
^ permalink raw reply [nested|flat] 9+ messages in thread

* pgsql: Fix gratuitous error message variation
@ 2019-11-08 17:40 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 9+ messages in thread

From: Peter Eisentraut @ 2019-11-08 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix gratuitous error message variation

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b34946f9a1d2743a485117cc069432d82907e265

Modified Files
--------------
src/backend/replication/logical/origin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* pgsql: Fix gratuitous error message variation
@ 2019-11-08 17:40 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 9+ messages in thread

From: Peter Eisentraut @ 2019-11-08 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix gratuitous error message variation

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c125bc8995dfdf905ba146550a14867a17982425

Modified Files
--------------
src/backend/replication/logical/origin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* pgsql: Fix gratuitous error message variation
@ 2019-11-08 17:40 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 9+ messages in thread

From: Peter Eisentraut @ 2019-11-08 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix gratuitous error message variation

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4cc66a2a4afca89208317928ec0c8721a999bb7d

Modified Files
--------------
src/backend/replication/logical/origin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* pgsql: Fix gratuitous error message variation
@ 2019-11-08 17:40 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 9+ messages in thread

From: Peter Eisentraut @ 2019-11-08 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix gratuitous error message variation

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a9c3cda2816ffef76a6f49cc7ba14233e8d9cad1

Modified Files
--------------
src/backend/replication/logical/origin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* pgsql: Fix gratuitous error message variation
@ 2019-11-08 17:40 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 9+ messages in thread

From: Peter Eisentraut @ 2019-11-08 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix gratuitous error message variation

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/64b62b7b9b8566a0b92986ce26de84101820b556

Modified Files
--------------
src/backend/replication/logical/origin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2019-11-09 13:13 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 17:40 pgsql: Fix gratuitous error message variation Peter Eisentraut <peter@eisentraut.org>
2019-11-09 01:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-09 08:01   ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2019-11-09 13:13     ` Euler Taveira <euler@timbira.com.br>
2019-11-08 17:40 pgsql: Fix gratuitous error message variation Peter Eisentraut <peter@eisentraut.org>
2019-11-08 17:40 pgsql: Fix gratuitous error message variation Peter Eisentraut <peter@eisentraut.org>
2019-11-08 17:40 pgsql: Fix gratuitous error message variation Peter Eisentraut <peter@eisentraut.org>
2019-11-08 17:40 pgsql: Fix gratuitous error message variation Peter Eisentraut <peter@eisentraut.org>
2019-11-08 17:40 pgsql: Fix gratuitous error message variation Peter Eisentraut <peter@eisentraut.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox