Skip to content

Commit 0b9650c

Browse files
committed
PGPRO-2040: PG10 has different field name, checkpoint_lsn
1 parent 517939d commit 0b9650c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,15 @@ get_checkpoint_location(PGconn *conn)
134134
uint32 lsn_lo;
135135
XLogRecPtr lsn;
136136

137+
#if PG_VERSION_NUM >= 100000
138+
res = pgut_execute(conn,
139+
"SELECT checkpoint_lsn FROM pg_catalog.pg_control_checkpoint()",
140+
0, NULL);
141+
#else
137142
res = pgut_execute(conn,
138143
"SELECT checkpoint_location FROM pg_catalog.pg_control_checkpoint()",
139144
0, NULL);
145+
#endif
140146
XLogDataFromLSN(PQgetvalue(res, 0, 0), &lsn_hi, &lsn_lo);
141147
PQclear(res);
142148
/* Calculate LSN */

0 commit comments

Comments
 (0)