Hi,

Presently, replication slot invalidation causes and their text are
scattered into ReplicationSlotInvalidationCause enum and a bunch of
macros. This is making the code to get invalidation cause text given
the cause as enum and vice-versa unreadable, longer and inextensible.
The attached patch adds a lookup table for all invalidation causes for
better readability and extensibility. FWIW, another patch in
discussion 
https://www.postgresql.org/message-id/CALj2ACWgACB4opnbqi=x7hc4aqcgkxolsh1vb+gfidxadqn...@mail.gmail.com
adds a couple of other invalidation reasons, this lookup table makes
the life easier and code shorter.

Thoughts?

-- 
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment: v1-0001-Add-lookup-table-for-replication-slot-invalidatio.patch
Description: Binary data

Reply via email to