diff options
Diffstat (limited to 'src/backend/replication/slotfuncs.c')
-rw-r--r-- | src/backend/replication/slotfuncs.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c index d2fa5e669a3..c108bf9608f 100644 --- a/src/backend/replication/slotfuncs.c +++ b/src/backend/replication/slotfuncs.c @@ -413,24 +413,12 @@ pg_get_replication_slots(PG_FUNCTION_ARGS) nulls[i++] = true; else { - switch (slot_contents.data.invalidated) - { - case RS_INVAL_NONE: - nulls[i++] = true; - break; - - case RS_INVAL_WAL_REMOVED: - values[i++] = CStringGetTextDatum(SLOT_INVAL_WAL_REMOVED_TEXT); - break; - - case RS_INVAL_HORIZON: - values[i++] = CStringGetTextDatum(SLOT_INVAL_HORIZON_TEXT); - break; - - case RS_INVAL_WAL_LEVEL: - values[i++] = CStringGetTextDatum(SLOT_INVAL_WAL_LEVEL_TEXT); - break; - } + ReplicationSlotInvalidationCause cause = slot_contents.data.invalidated; + + if (cause == RS_INVAL_NONE) + nulls[i++] = true; + else + values[i++] = CStringGetTextDatum(SlotInvalidationCauses[cause]); } values[i++] = BoolGetDatum(slot_contents.data.failover); |