Re: Enumize logical replication message actions

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, andres@anarazel.de, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, amit.kapila16@gmail.com
Date: 2020-10-23T01:31:41Z
Lists: pgsql-hackers
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?



Commits

  1. Use Enums for logical replication message types at more places.

  2. Use Enum for top level logical replication message types.