@@ -959,15 +959,27 @@ wait_replica_wal_lsn(XLogRecPtr lsn, bool is_start_backup)
959959 * data.
960960 */
961961if (is_start_backup )
962- res = pgut_execute (backup_conn ,"SELECT pg_last_xlog_replay_location()" ,
963- 0 ,NULL );
962+ {
963+ if (server_version >=100000 )
964+ res = pgut_execute (backup_conn ,"SELECT pg_last_wal_replay_lsn()" ,
965+ 0 ,NULL );
966+ else
967+ res = pgut_execute (backup_conn ,"SELECT pg_last_xlog_replay_location()" ,
968+ 0 ,NULL );
969+ }
964970/*
965971 * For lsn from pg_stop_backup() we need it only to be received by
966972 * replica and fsync()'ed on WAL segment.
967973 */
968974else
969- res = pgut_execute (backup_conn ,"SELECT pg_last_xlog_receive_location()" ,
970- 0 ,NULL );
975+ {
976+ if (server_version >=100000 )
977+ res = pgut_execute (backup_conn ,"SELECT pg_last_wal_receive_lsn()" ,
978+ 0 ,NULL );
979+ else
980+ res = pgut_execute (backup_conn ,"SELECT pg_last_xlog_receive_location()" ,
981+ 0 ,NULL );
982+ }
971983
972984/* Extract timeline and LSN from result */
973985XLogDataFromLSN (PQgetvalue (res ,0 ,0 ),& xlogid ,& xrecoff );