From ea416d98d71cbac628a3cb2cb45d65b9f094bd15 Mon Sep 17 00:00:00 2001 From: Feike Steenbergen Date: Tue, 26 May 2015 15:40:32 +0200 Subject: [PATCH] Api: Bugfix for current_xlog_location in slaves. --- helpers/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helpers/api.py b/helpers/api.py index f0d47e10..83aa619b 100644 --- a/helpers/api.py +++ b/helpers/api.py @@ -37,7 +37,9 @@ class RestApiHandler(BaseHTTPRequestHandler): cursor = self.server.cursor() cursor.execute("""SELECT to_char(pg_postmaster_start_time(), 'YYYY-MM-DD HH24:MI:SS.MS TZ'), pg_is_in_recovery(), - pg_current_xlog_location(), + CASE WHEN pg_is_in_recovery() + THEN null + ELSE pg_current_xlog_location() END, pg_last_xlog_receive_location(), pg_last_xlog_replay_location(), pg_is_in_recovery() AND pg_is_xlog_replay_paused()""")