Re: Skipping logical replication transactions on subscriber side - Mailing list pgsql-hackers

From Greg Nancarrow
Subject Re: Skipping logical replication transactions on subscriber side
Date
Msg-id CAJcOf-fFaRTa7LH0_iMfEWmQaeRxxm67bibn98GX7xRp8UAfAg@mail.gmail.com
Whole thread Raw
In response to Re: Skipping logical replication transactions on subscriber side  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Thu, Aug 19, 2021 at 4:51 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> The action in apply_dispatch is always a single byte so not sure why
> we need %d here. Also, if it is used as %c before the patch then I
> think it is better not to change it in this patch.
>

As I explained before, the point is that all the known message types
are handled in the switch statement cases (and you will get a compiler
warning if you miss one of the enum values in the switch cases).
So anything NOT handled in the switch, will be some OTHER value (and
note that any "int" value can be assigned to an enum).
Who says its value will be a printable character (%c) in this case?
And even if it is printable, will it help?
I think in this case it would be better to know the exact value of the
byte ("%d" or "0x%x" etc.), not the character equivalent.
I'm OK if it's done as a separate patch.

Regards,
Greg Nancarrow
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: elog.c query_id support vs shutdown
Next
From: Daniel Gustafsson
Date:
Subject: Re: strange case of "if ((a & b))"