Skip to content

Commit 479b69a

Browse files
committed
Set minimum required version of zstd as 1.4.0.
It emerges that our new zstd code depends on features that were not present (or at least not enabled by default) in zstd before 1.4.0. That's already four years old, so there's little reason to try to make our code work with something older. Instead make configure check that zstd is at least 1.4.0, and document this requirement. Justin Pryzby (doc changes by me) Discussion: https://postgr.es/m/efbd94cd1102f99fd1300e44905ee4a994ee2ef6.camel@gunduz.org
1 parent c1932e5 commit 479b69a

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

configure

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9092,19 +9092,19 @@ $as_echo "$with_zstd" >&6; }
90929092
if test "$with_zstd" = yes; then
90939093

90949094
pkg_failed=no
9095-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd" >&5
9096-
$as_echo_n "checking for libzstd... " >&6; }
9095+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd >= 1.4.0" >&5
9096+
$as_echo_n "checking for libzstd >= 1.4.0... " >&6; }
90979097

90989098
if test -n "$ZSTD_CFLAGS"; then
90999099
pkg_cv_ZSTD_CFLAGS="$ZSTD_CFLAGS"
91009100
elif test -n "$PKG_CONFIG"; then
91019101
if test -n "$PKG_CONFIG" && \
9102-
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5
9103-
($PKG_CONFIG --exists --print-errors "libzstd") 2>&5
9102+
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd >= 1.4.0\""; } >&5
9103+
($PKG_CONFIG --exists --print-errors "libzstd >= 1.4.0") 2>&5
91049104
ac_status=$?
91059105
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
91069106
test $ac_status = 0; }; then
9107-
pkg_cv_ZSTD_CFLAGS=`$PKG_CONFIG --cflags "libzstd" 2>/dev/null`
9107+
pkg_cv_ZSTD_CFLAGS=`$PKG_CONFIG --cflags "libzstd >= 1.4.0" 2>/dev/null`
91089108
test "x$?" != "x0" && pkg_failed=yes
91099109
else
91109110
pkg_failed=yes
@@ -9116,12 +9116,12 @@ if test -n "$ZSTD_LIBS"; then
91169116
pkg_cv_ZSTD_LIBS="$ZSTD_LIBS"
91179117
elif test -n "$PKG_CONFIG"; then
91189118
if test -n "$PKG_CONFIG" && \
9119-
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5
9120-
($PKG_CONFIG --exists --print-errors "libzstd") 2>&5
9119+
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd >= 1.4.0\""; } >&5
9120+
($PKG_CONFIG --exists --print-errors "libzstd >= 1.4.0") 2>&5
91219121
ac_status=$?
91229122
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
91239123
test $ac_status = 0; }; then
9124-
pkg_cv_ZSTD_LIBS=`$PKG_CONFIG --libs "libzstd" 2>/dev/null`
9124+
pkg_cv_ZSTD_LIBS=`$PKG_CONFIG --libs "libzstd >= 1.4.0" 2>/dev/null`
91259125
test "x$?" != "x0" && pkg_failed=yes
91269126
else
91279127
pkg_failed=yes
@@ -9142,14 +9142,14 @@ else
91429142
_pkg_short_errors_supported=no
91439143
fi
91449144
if test $_pkg_short_errors_supported = yes; then
9145-
ZSTD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd" 2>&1`
9145+
ZSTD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd >= 1.4.0" 2>&1`
91469146
else
9147-
ZSTD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd" 2>&1`
9147+
ZSTD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd >= 1.4.0" 2>&1`
91489148
fi
91499149
# Put the nasty error message in config.log where it belongs
91509150
echo "$ZSTD_PKG_ERRORS" >&5
91519151

9152-
as_fn_error $? "Package requirements (libzstd) were not met:
9152+
as_fn_error $? "Package requirements (libzstd >= 1.4.0) were not met:
91539153

91549154
$ZSTD_PKG_ERRORS
91559155

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ AC_MSG_RESULT([$with_zstd])
10731073
AC_SUBST(with_zstd)
10741074

10751075
if test "$with_zstd" = yes; then
1076-
PKG_CHECK_MODULES(ZSTD, libzstd)
1076+
PKG_CHECK_MODULES(ZSTD, libzstd >= 1.4.0)
10771077
# We only care about -I, -D, and -L switches;
10781078
# note that -lzstd will be added by AC_CHECK_LIB below.
10791079
for pgac_option in $ZSTD_CFLAGS; do

doc/src/sgml/installation.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ su - postgres
250250
encrypted client connections. <productname>OpenSSL</productname> is
251251
also required for random number generation on platforms that do not
252252
have <filename>/dev/urandom</filename> (except Windows). The minimum
253-
version required is 1.0.1.
253+
required version is 1.0.1.
254254
</para>
255255
</listitem>
256256

@@ -265,7 +265,7 @@ su - postgres
265265
<listitem>
266266
<para>
267267
You need <productname>LZ4</productname>, if you want to support
268-
compression of data with this method; see
268+
compression of data with that method; see
269269
<xref linkend="guc-default-toast-compression"/> and
270270
<xref linkend="guc-wal-compression"/>.
271271
</para>
@@ -274,8 +274,9 @@ su - postgres
274274
<listitem>
275275
<para>
276276
You need <productname>zstd</productname>, if you want to support
277-
compression of data with this method; see
277+
compression of data with that method; see
278278
<xref linkend="guc-wal-compression"/>.
279+
The minimum required version is 1.4.0.
279280
</para>
280281
</listitem>
281282

0 commit comments

Comments
 (0)