--- a/src/semver.c
+++ b/src/semver.c
@@ -19,6 +19,9 @@
 #include "access/hash.h"
 #include "lib/stringinfo.h"
 #include "libpq/pqformat.h"
+#if PG_VERSION_NUM >= 160000
+#include "varatt.h"
+#endif
 
 #ifdef PG_MODULE_MAGIC
 PG_MODULE_MAGIC;
