Re: Add common function ReplicationOriginName. - Mailing list pgsql-hackers

From Peter Smith
Subject Re: Add common function ReplicationOriginName.
Date
Msg-id CAHut+PvB6N_-JK46-0U0T8x0i4oqnEB_BL4R9yHYt6bFj8pqBw@mail.gmail.com
Whole thread Raw
In response to Re: Add common function ReplicationOriginName.  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: Add common function ReplicationOriginName.
List pgsql-hackers
On Tue, Sep 20, 2022 at 6:36 PM Aleksander Alekseev
<aleksander@timescale.com> wrote:
>
> Hi Amit,
>
> > I think it is better to use Size. Even though, it may not fail now as
> > the size of names for origin will always be much lesser but it is
> > better if we are consistent. If we agree with this, then as a first
> > patch, we can make it to use Size in existing places and then
> > introduce this new function.
>
> OK, here is the updated patchset.
>
> * 0001 replaces int's with Size's in the existing code
> * 0002 applies Peter's patch on top of 0001
>

Hi Aleksander.

FYI - although it is outside the scope of this thread, I did notice at
least one other example where you might want to substitute Size for
int in the same way as your v2-0001 patch did.

e.g. Just searching code for 'snprintf' where there is some parameter
for the size I quickly found:

File: src/bin/pg_dump/pg_dump_sort.c:

static void
describeDumpableObject(DumpableObject *obj, char *buf, int bufsize)

caller:
describeDumpableObject(loop[i], buf, sizeof(buf));

~~

I expect you can find more like just this if you look harder than I did.

------
Kind Regards,
Peter Smith.
Fujitsu Australia.



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: A doubt about a newly added errdetail
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: pgstat: stats added in ReadPageInternal() aren't getting reported via pg_stat_wal