Use Enum for top level logical replication message types.
Amit Kapila <akapila@postgresql.org>
Use Enum for top level logical replication message types. Logical replication protocol uses a single byte character to identify a message type in logical replication protocol. The code uses string literals for the same. Use Enum so that 1. All the string literals used can be found at a single place. This makes it easy to add more types without the risk of conflicts. 2. It's easy to locate the code handling a given message type. 3. When used with switch statements, it is easy to identify the missing cases using -Wswitch. Author: Ashutosh Bapat Reviewed-by: Kyotaro Horiguchi, Andres Freund, Peter Smith and Amit Kapila Discussion: https://postgr.es/m/CAExHW5uPzQ7L0oAd_ENyvaiYMOPgkrAoJpE+ZY5-obdcVT6NPg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/replication/logical/proto.c | modified | +13 −13 |
| src/backend/replication/logical/worker.c | modified | +43 −44 |
| src/include/replication/logicalproto.h | modified | +27 −0 |
Discussion
- Enumize logical replication message actions 33 messages · 2020-10-16 → 2020-11-26