Re: Add a hook for handling logical decoding messages on subscribers. - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Add a hook for handling logical decoding messages on subscribers.
Date
Msg-id CAA4eK1Jd7ZRi7Nx3xkrAE=qjn4cRHF893zw7AaQ5KLYJBSSKiQ@mail.gmail.com
Whole thread
In response to Re: Add a hook for handling logical decoding messages on subscribers.  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Mon, Sep 21, 2026 at 11:53 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Fri, Sep 18, 2026 at 6:13 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> >
> > Thanks for reviewing the patch!
> >
> > While I also think the patch is in good shape, I'd like to raise a
> > security risk this feature might introduce, particularly around
> > pg_logical_emit_message():
> >
>
> Review comments:
> ===============
>

One more comment:
+static void
+apply_handle_message(StringInfo s)
+{
+ LogicalRepMessageData msg;
+
+ /* Tablesync worker should never receive MESSAGE */
+ if (am_tablesync_worker())
+ ereport(ERROR,
+ errcode(ERRCODE_PROTOCOL_VIOLATION),
+ errmsg_internal("tablesync worker received a MESSAGE message"));

I think we should have a similar ERROR for parallel apply worker. I
don't think this message can reach there but we should protect it like
above.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Palak Chaturvedi
Date:
Subject: Re: Make pg_prewarm, autoprewarm yield for waiting DDL
Next
From: Chao Li
Date:
Subject: Re: pg_walinspect: fix LSN validation messages and empty range handling