summaryrefslogtreecommitdiff
path: root/src/bin/pg_upgrade/info.c
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2024-01-04 08:21:51 +0530
committerAmit Kapila <akapila@postgresql.org>2024-01-04 08:26:25 +0530
commit007693f2a3ac2ac19affcb03ad43cdb36ccff5b5 (patch)
tree548cee95ca1d16e7b7f87baa951e779bf8f0dfd1 /src/bin/pg_upgrade/info.c
parent29275b1d177096597675b5c6e7e7c9db2df8f4df (diff)
Track conflict_reason in pg_replication_slots.
This patch changes the existing 'conflicting' field to 'conflict_reason' in pg_replication_slots. This new field indicates the reason for the logical slot's conflict with recovery. It is always NULL for physical slots, as well as for logical slots which are not invalidated. The non-NULL values indicate that the slot is marked as invalidated. Possible values are: wal_removed = required WAL has been removed. rows_removed = required rows have been removed. wal_level_insufficient = the primary doesn't have a wal_level sufficient to perform logical decoding. The existing users of 'conflicting' column can get the same answer by using 'conflict_reason' IS NOT NULL. Author: Shveta Malik Reviewed-by: Amit Kapila, Bertrand Drouvot, Michael Paquier Discussion: https://postgr.es/m/ZYOE8IguqTbp-seF@paquier.xyz
Diffstat (limited to 'src/bin/pg_upgrade/info.c')
-rw-r--r--src/bin/pg_upgrade/info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index c52501c8fb6..190dd53a427 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -667,13 +667,13 @@ get_old_cluster_logical_slot_infos(DbInfo *dbinfo, bool live_check)
* removed.
*/
res = executeQueryOrDie(conn, "SELECT slot_name, plugin, two_phase, "
- "%s as caught_up, conflicting as invalid "
+ "%s as caught_up, conflict_reason IS NOT NULL as invalid "
"FROM pg_catalog.pg_replication_slots "
"WHERE slot_type = 'logical' AND "
"database = current_database() AND "
"temporary IS FALSE;",
live_check ? "FALSE" :
- "(CASE WHEN conflicting THEN FALSE "
+ "(CASE WHEN conflict_reason IS NOT NULL THEN FALSE "
"ELSE (SELECT pg_catalog.binary_upgrade_logical_slot_has_caught_up(slot_name)) "
"END)");