aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/src/sgml/protocol.sgml6
-rw-r--r--src/common/compression.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index f63c912e971..75caa7fdb67 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2757,8 +2757,10 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
<literal>-1</literal>), for <literal>lz4</literal> an integer
between 1 and 12 (default <literal>0</literal> for fast compression
mode), and for <literal>zstd</literal> an integer between
- <literal>1</literal> and <literal>22</literal> (default
- <literal>ZSTD_CLEVEL_DEFAULT</literal> or <literal>3</literal>).
+ <literal>ZSTD_minCLevel()</literal> (usually <literal>-131072</literal>)
+ and <literal>ZSTD_maxCLevel()</literal> (usually <literal>22</literal>),
+ (default <literal>ZSTD_CLEVEL_DEFAULT</literal> or
+ <literal>3</literal>).
</para>
<para>
diff --git a/src/common/compression.c b/src/common/compression.c
index e40ce98ef3a..0c6bb9177b9 100644
--- a/src/common/compression.c
+++ b/src/common/compression.c
@@ -324,8 +324,9 @@ validate_compress_specification(pg_compress_specification *spec)
default_level = 0; /* fast mode */
break;
case PG_COMPRESSION_ZSTD:
- max_level = 22;
#ifdef USE_ZSTD
+ max_level = ZSTD_maxCLevel();
+ min_level = ZSTD_minCLevel();
default_level = ZSTD_CLEVEL_DEFAULT;
#endif
break;