On Fri, 23 Oct 2020 at 06:50, Kyotaro Horiguchi <horikyota....@gmail.com>
wrote:

>
> Those two switch()es are apparently redundant. That code is exactly
> equivalent to:
>
> apply_dispatch(s)
> {
>   LogicalRepMsgType msgtype = pq_getmsgtype(s);
>
>   switch (msgtype)
>   {
>      case LOGICAL_REP_MSG_BEGIN:
>         apply_handle_begin();
> !       return;
>      ...
>      case LOGICAL_REP_MSG_STREAM_COMMIT:
>         apply_handle_begin();
> !       return;
>   }
>
>   ereport(ERROR, (errmsg("invalid logical replication message type"..
> }
>
> which is smaller and fast.
>

Good idea. Implemented in the latest patch posted with the next mail.

-- 
Best Wishes,
Ashutosh

Reply via email to