Re: Enumize logical replication message actions

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: Enumize logical replication message actions
Дата
Msg-id CAG-ACPWtdmodX9p0Xh4NRH_fA+TkU1HV_sXChnSXRuBJtDVFuQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Enumize logical replication message actions  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers


On Fri, 23 Oct 2020 at 06:50, Kyotaro Horiguchi <horikyota.ntt@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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: git clone failed in windows
Следующее
От: Dave Page
Дата:
Сообщение: Re: git clone failed in windows