Skip to content

Commit 882a768

Browse files
authored
postgresql: configurable blocksize (#411966)
2 parents 969308f + 6ca1ec9 commit 882a768

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pkgs/servers/sql/postgresql/generic.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ let
4949
stdenvNoCC,
5050
testers,
5151

52+
# Block size
53+
# Changing the block size will break on-disk database compatibility. See:
54+
# https://www.postgresql.org/docs/current/install-make.html#CONFIGURE-OPTION-WITH-BLOCKSIZE
55+
withBlocksize ? null,
56+
withWalBlocksize ? null,
57+
5258
# bonjour
5359
bonjourSupport ? false,
5460

@@ -318,6 +324,8 @@ let
318324
(if stdenv.hostPlatform.isFreeBSD then "--with-uuid=bsd" else "--with-uuid=e2fs")
319325
(withFeature perlSupport "perl")
320326
]
327+
++ lib.optionals (withBlocksize != null) [ "--with-blocksize=${toString withBlocksize}" ]
328+
++ lib.optionals (withWalBlocksize != null) [ "--with-wal-blocksize=${toString withWalBlocksize}" ]
321329
++ lib.optionals lz4Enabled [ "--with-lz4" ]
322330
++ lib.optionals zstdEnabled [ "--with-zstd" ]
323331
++ lib.optionals gssSupport [ "--with-gssapi" ]
@@ -501,7 +509,11 @@ let
501509
!(stdenv'.hostPlatform.isDarwin)
502510
&&
503511
# Regression tests currently fail in pkgsMusl because of a difference in EXPLAIN output.
504-
!(stdenv'.hostPlatform.isMusl);
512+
!(stdenv'.hostPlatform.isMusl)
513+
&&
514+
# Modifying block sizes is expected to break regression tests.
515+
# https://www.postgresql.org/message-id/E1TJOeZ-000717-Lg%40wrigleys.postgresql.org
516+
(withBlocksize == null && withWalBlocksize == null);
505517
installCheckTarget = "check-world";
506518

507519
passthru =

0 commit comments

Comments
 (0)