Fix header inclusion order in xloginsert.c with lz4.h
authorMichael Paquier <michael@paquier.xyz>
Fri, 11 Mar 2022 01:59:47 +0000 (10:59 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 11 Mar 2022 01:59:47 +0000 (10:59 +0900)
Per project policy, all system and library headers need to be declared
in the backend code after "postgres.h" and before the internal headers,
but 4035cd5 broke this policy when adding support for LZ4 in
wal_compression.

Noticed while reviewing the patch to add support for zstd in this area.
This only impacts HEAD, so there is no need for a back-patch.

src/backend/access/transam/xloginsert.c

index c260310c4c86608e13b363ff6ecb6da256b0b097..83d40b55e6157c4ab5d48068fa469581a9f6bcb1 100644 (file)
 
 #include "postgres.h"
 
+#ifdef USE_LZ4
+#include <lz4.h>
+#endif
+
 #include "access/xact.h"
 #include "access/xlog.h"
 #include "access/xlog_internal.h"
@@ -38,7 +42,6 @@
  * backup block image.
  */
 #ifdef USE_LZ4
-#include <lz4.h>
 #define    LZ4_MAX_BLCKSZ      LZ4_COMPRESSBOUND(BLCKSZ)
 #else
 #define LZ4_MAX_BLCKSZ     0