From bb9a35061a469cf178dd7afcf44263e1bc518141 Mon Sep 17 00:00:00 2001
From: Nick Carboni <ncarboni@redhat.com>
Date: Thu, 7 Feb 2019 15:01:16 -0500
Subject: [PATCH] Update methods referencing xlog to use newer wal versions

These functions were renamed in PG 10

Fixes #16052
---
 lib/extensions/ar_adapter/ar_dba.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/extensions/ar_adapter/ar_dba.rb b/lib/extensions/ar_adapter/ar_dba.rb
index 25c78f73e1f..e44024a4912 100644
--- a/lib/extensions/ar_adapter/ar_dba.rb
+++ b/lib/extensions/ar_adapter/ar_dba.rb
@@ -12,11 +12,11 @@ def spid
   end
 
   def xlog_location
-    select_value("SELECT pg_current_xlog_insert_location()")
+    select_value("SELECT pg_current_wal_insert_lsn()")
   end
 
   def xlog_location_diff(lsn1, lsn2)
-    select_value("SELECT pg_xlog_location_diff(#{quote(lsn1)}, #{quote(lsn2)})").to_i
+    select_value("SELECT pg_wal_lsn_diff(#{quote(lsn1)}, #{quote(lsn2)})").to_i
   end
 
   def client_connections