Skip to content

Commit 70f3732

Browse files
committed
Fix cluster status query on 9.6
1 parent 23ed5e0 commit 70f3732

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

patroni/postgresql/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ def cluster_info_query(self) -> str:
252252
written_lsn = ("pg_catalog.pg_wal_lsn_diff(written_lsn, '0/0')::bigint"
253253
if self._major_version >= 130000 else "NULL")
254254
extra = (", CASE WHEN latest_end_lsn IS NULL THEN NULL ELSE received_tli END, {0}, "
255-
"pg_catalog.pg_wal_lsn_diff(latest_end_lsn, '0/0')::bigint, slot_name, "
256-
"conninfo, status, {1} FROM pg_catalog.pg_stat_get_wal_receiver()").format(written_lsn, extra)
255+
"pg_catalog.pg_{2}_{3}_diff(latest_end_lsn, '0/0')::bigint, slot_name, "
256+
"conninfo, status, {1} FROM pg_catalog.pg_stat_get_wal_receiver()"
257+
).format(written_lsn, extra, self.wal_name, self.lsn_name)
257258
if self.role == PostgresqlRole.STANDBY_LEADER:
258259
extra = "timeline_id" + extra + ", pg_catalog.pg_control_checkpoint()"
259260
else:

0 commit comments

Comments
 (0)