Re: Enumize logical replication message actions
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-10-16T11:13:58Z
Lists: pgsql-hackers
On Fri, Oct 16, 2020 at 12:55 PM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote: > > Hi All, > Logical replication protocol uses single byte character to identify > different chunks of logical repliation messages. The code uses > character literals for the same. These literals are used as bare > constants in code as well. That's true for almost all the code that > deals with wire protocol. With that it becomes difficult to identify > the code which deals with a particular message. For example code that > deals with message type 'B'. In various protocol 'B' has different > meaning and it gets difficult and time consuming to differentiate one > usage from other and find all places which deal with one usage. Here's > a patch simplifying that for top level logical replication messages. > +1. I think this will make the code easier to read and understand. I think it would be good to do this in some other parts as well but starting with logical replication is a good idea as that area is still evolving. -- With Regards, Amit Kapila.
Commits
-
Use Enums for logical replication message types at more places.
- f3a8f73ec274 14.0 landed
-
Use Enum for top level logical replication message types.
- 644f0d7cc9c2 14.0 landed