Avoid using PG_VERSION_NUM in frontend code

Debian.
This commit is contained in:
Ian Barwick
2017-08-01 10:43:42 +09:00
parent 8a5665a421
commit 3683d096f1

View File

@@ -2793,13 +2793,18 @@ request_vote(PGconn *conn, t_node_info *this_node, t_node_info *other_node, int
initPQExpBuffer(&query); initPQExpBuffer(&query);
appendPQExpBuffer( if (server_version_num >= 100000)
&query, {
#if (PG_VERSION_NUM >= 100000) appendPQExpBuffer(
"SELECT pg_catalog.pg_last_wal_receive_lsn()"); &query,
#else "SELECT pg_catalog.pg_last_wal_receive_lsn()");
"SELECT pg_catalog.pg_last_xlog_receive_location()"); }
#endif else
{
appendPQExpBuffer(
&query,
"SELECT pg_catalog.pg_last_xlog_receive_location()");
}
res = PQexec(conn, query.data); res = PQexec(conn, query.data);
termPQExpBuffer(&query); termPQExpBuffer(&query);