pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Refer to replication origin roident as "ID" in user facing messa
6+ messages / 3 participants
[nested] [flat]
Commits from this thread:
2022-08-23 ba8321349b 73cbdb7f19 Switch format specifier for replication origins to %d
* pgsql: Refer to replication origin roident as "ID" in user facing messa
@ 2022-08-18 02:10 John Naylor <john.naylor@postgresql.org>
2022-08-18 09:49 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa Peter Eisentraut <peter.eisentraut@enterprisedb.com>
0 siblings, 1 reply; 6+ messages in thread
From: John Naylor @ 2022-08-18 02:10 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c920fe48181d81ce218faa746f8af92c41d03b2e
Modified Files
--------------
doc/src/sgml/replication-origins.sgml | 4 ++--
src/backend/replication/logical/origin.c | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql: Refer to replication origin roident as "ID" in user facing messa
2022-08-18 02:10 pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@postgresql.org>
@ 2022-08-18 09:49 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-08-19 01:06 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@enterprisedb.com>
0 siblings, 1 reply; 6+ messages in thread
From: Peter Eisentraut @ 2022-08-18 09:49 UTC (permalink / raw)
To: John Naylor <john.naylor@postgresql.org>; pgsql-committers@lists.postgresql.org
On 18.08.22 04:10, John Naylor wrote:
> While at it, most format strings already use %u, so for consintency
> change the remaining stragglers using %d.
This is incorrect. Replication origin IDs are of type uint16, which
gets promoted to int in a variable arguments list, so %d is the correct
placeholder.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql: Refer to replication origin roident as "ID" in user facing messa
2022-08-18 02:10 pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@postgresql.org>
2022-08-18 09:49 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa Peter Eisentraut <peter.eisentraut@enterprisedb.com>
@ 2022-08-19 01:06 ` John Naylor <john.naylor@enterprisedb.com>
2022-08-22 14:35 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa Peter Eisentraut <peter.eisentraut@enterprisedb.com>
0 siblings, 1 reply; 6+ messages in thread
From: John Naylor @ 2022-08-19 01:06 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: John Naylor <john.naylor@postgresql.org>; pgsql-committers@lists.postgresql.org
On Thu, Aug 18, 2022 at 4:49 PM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
>
> On 18.08.22 04:10, John Naylor wrote:
> > While at it, most format strings already use %u, so for consintency
> > change the remaining stragglers using %d.
>
> This is incorrect. Replication origin IDs are of type uint16, which
> gets promoted to int in a variable arguments list, so %d is the correct
> placeholder.
I would think that for uint16, either %d or %u would have the same
result. Is there some other consideration I'm not aware of?
--
John Naylor
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql: Refer to replication origin roident as "ID" in user facing messa
2022-08-18 02:10 pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@postgresql.org>
2022-08-18 09:49 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-08-19 01:06 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@enterprisedb.com>
@ 2022-08-22 14:35 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-08-23 02:58 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@enterprisedb.com>
0 siblings, 1 reply; 6+ messages in thread
From: Peter Eisentraut @ 2022-08-22 14:35 UTC (permalink / raw)
To: John Naylor <john.naylor@enterprisedb.com>; +Cc: John Naylor <john.naylor@postgresql.org>; pgsql-committers@lists.postgresql.org
On 19.08.22 03:06, John Naylor wrote:
> On Thu, Aug 18, 2022 at 4:49 PM Peter Eisentraut
> <peter.eisentraut@enterprisedb.com> wrote:
>>
>> On 18.08.22 04:10, John Naylor wrote:
>>> While at it, most format strings already use %u, so for consintency
>>> change the remaining stragglers using %d.
>>
>> This is incorrect. Replication origin IDs are of type uint16, which
>> gets promoted to int in a variable arguments list, so %d is the correct
>> placeholder.
>
> I would think that for uint16, either %d or %u would have the same
> result. Is there some other consideration I'm not aware of?
Every once in a while, I build PostgreSQL with -Wformat-signedness,
which often finds issues with OIDs and timeline IDs printed with the
wrong placeholder. There is a lot of noise to skip past when doing
that, but in the long run it would be nice if we didn't add more of it.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql: Refer to replication origin roident as "ID" in user facing messa
2022-08-18 02:10 pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@postgresql.org>
2022-08-18 09:49 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-08-19 01:06 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@enterprisedb.com>
2022-08-22 14:35 ` Re: pgsql: Refer to replication origin roident as "ID" in user facing messa Peter Eisentraut <peter.eisentraut@enterprisedb.com>
@ 2022-08-23 02:58 ` John Naylor <john.naylor@enterprisedb.com>
0 siblings, 0 replies; 6+ messages in thread
From: John Naylor @ 2022-08-23 02:58 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: John Naylor <john.naylor@postgresql.org>; pgsql-committers@lists.postgresql.org
On Mon, Aug 22, 2022 at 9:35 PM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
>
> On 19.08.22 03:06, John Naylor wrote:
> > On Thu, Aug 18, 2022 at 4:49 PM Peter Eisentraut
> > <peter.eisentraut@enterprisedb.com> wrote:
> >>
> >> On 18.08.22 04:10, John Naylor wrote:
> >>> While at it, most format strings already use %u, so for consintency
> >>> change the remaining stragglers using %d.
> >>
> >> This is incorrect. Replication origin IDs are of type uint16, which
> >> gets promoted to int in a variable arguments list, so %d is the correct
> >> placeholder.
> >
> > I would think that for uint16, either %d or %u would have the same
> > result. Is there some other consideration I'm not aware of?
>
> Every once in a while, I build PostgreSQL with -Wformat-signedness,
> which often finds issues with OIDs and timeline IDs printed with the
> wrong placeholder. There is a lot of noise to skip past when doing
> that, but in the long run it would be nice if we didn't add more of it.
Thanks for the info; I've pushed a patch.
--
John Naylor
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Refer to replication origin roident as "ID" in user facing messa
@ 2022-08-18 02:10 John Naylor <john.naylor@postgresql.org>
0 siblings, 0 replies; 6+ messages in thread
From: John Naylor @ 2022-08-18 02:10 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
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
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/7cadaac5130ec60d905c5ad69af98056b54c4e37
Modified Files
--------------
doc/src/sgml/replication-origins.sgml | 4 ++--
src/backend/replication/logical/origin.c | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2022-08-23 02:58 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 02:10 pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@postgresql.org>
2022-08-18 09:49 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-08-19 01:06 ` John Naylor <john.naylor@enterprisedb.com>
2022-08-22 14:35 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-08-23 02:58 ` John Naylor <john.naylor@enterprisedb.com>
2022-08-18 02:10 pgsql: Refer to replication origin roident as "ID" in user facing messa John Naylor <john.naylor@postgresql.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