Add lookup table for replication slot invalidation causes - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Add lookup table for replication slot invalidation causes
Date
Msg-id CALj2ACUxSLA91QGFrJsWNKs58KXb1C03mbuwKmzqqmoAKLwJaw@mail.gmail.com
Whole thread Raw
Responses Re: Add lookup table for replication slot invalidation causes
List pgsql-hackers
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+gfidXaDQNu_Q@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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Have pg_basebackup write "dbname" in "primary_conninfo"?
Next
From: Amit Kapila
Date:
Subject: Re: A new message seems missing a punctuation