Re: Enumize logical replication message actions

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Enumize logical replication message actions
Дата
Msg-id CAA4eK1KQ8-scE5VUyXEyOP2f36CN3VckGVtX+=kCgfbCKHqGuA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Enumize logical replication message actions  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: Enumize logical replication message actions  (Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>)
Список pgsql-hackers
On Fri, Oct 23, 2020 at 11:50 AM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> At Thu, 22 Oct 2020 22:31:41 -0300, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote in
> > On 2020-Oct-22, Ashutosh Bapat wrote:
> >
> > > On Thu, 22 Oct 2020 at 14:46, Kyotaro Horiguchi <horikyota.ntt@gmail.com>
> > > wrote:
> >
> > > > pg_send_logicalrep_msg_type() looks somewhat too-much.  If we need
> > > > something like that we shouldn't do this refactoring, I think.
> > >
> > > Enum is an integer, and we want to send byte. The function asserts that the
> > > enum fits a byte. If there's a way to declare byte long enums I would use
> > > that. But I didn't find a way to do that.
> >
> > I didn't look at the code, but maybe it's sufficient to add a
> > StaticAssert?
>
> That check needs to visit all symbols in a enum and confirm that each
> of them is in a certain range.
>

Can we define something like LOGICAL_REP_MSG_LAST (also add a comment
indicating this is a fake message and must be the last one) as the
last and just check that?

-- 
With Regards,
Amit Kapila.



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

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Enumize logical replication message actions
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Enumize logical replication message actions