Re: logicalrep_message_type throws an error - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: logicalrep_message_type throws an error
Date
Msg-id CAD21AoDj4MfBF1t3b30zihqK-mZkU7kZtqMoxUL9AgLzFDgU3w@mail.gmail.com
Whole thread Raw
In response to Re: logicalrep_message_type throws an error  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Responses Re: logicalrep_message_type throws an error
List pgsql-hackers
On Fri, Jul 21, 2023 at 1:39 AM Ashutosh Bapat
<ashutosh.bapat.oss@gmail.com> wrote:
>
> On Thu, Jul 20, 2023 at 9:11 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
> > >
> > > Okay, changed it accordingly.
> > >
> >
> > oops, forgot to attach the patch.
> >
>
> WFM
>
> @@ -3367,7 +3367,7 @@ apply_dispatch(StringInfo s)
>          default:
>              ereport(ERROR,
>                      (errcode(ERRCODE_PROTOCOL_VIOLATION),
> -                     errmsg("invalid logical replication message type
> \"%c\"", action)));
> +                     errmsg("invalid logical replication message type
> \"??? (%d)\"", action)));
>
> I think we should report character here since that's what is visible
> in the code and also the message types are communicated as characters
> not integers. Makes debugging easier. Context may report integer as an
> additional data point.

I think it could confuse us if an invalid message is not a printable character.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: Row pattern recognition
Next
From: Masahiko Sawada
Date:
Subject: Re: doc: improve the restriction description of using indexes on REPLICA IDENTITY FULL table.