diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c
index c30ed407be6e14bd33ad6d0c5eb45bf108003477..38eb9783a544ac6c418c0aad791c131ccd8e7def 100644
--- a/contrib/pageinspect/heapfuncs.c
+++ b/contrib/pageinspect/heapfuncs.c
@@ -459,7 +459,7 @@ tuple_data_split(PG_FUNCTION_ARGS)
 		if (t_bits_str)
 			ereport(ERROR,
 					(errcode(ERRCODE_DATA_CORRUPTED),
-					 errmsg("t_bits string is expected to be NULL, but instead it is %lu bytes length",
+					 errmsg("t_bits string is expected to be NULL, but instead it is %zu bytes length",
 							strlen(t_bits_str))));
 	}