pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Use min/max bounds defined by Zstd for compression level
2+ messages / 1 participants
[nested] [flat]

* pgsql: Use min/max bounds defined by Zstd for compression level
@ 2022-09-22 11:04 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2022-09-22 11:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use min/max bounds defined by Zstd for compression level

The bounds hardcoded in compression.c since ffd5365 (minimum at 1 and
maximum at 22) do not match the reality of what zstd is able to
handle, these values being available via ZSTD_maxCLevel() and
ZSTD_minCLevel() at run-time.  The maximum of 22 is actually correct
in recent versions, but the minimum was not as the library can go down
to -131720 by design.  This commit changes the code to use the run-time
values in the code instead of some hardcoded ones.

Zstd seems to assume that these bounds could change in the future, and
Postgres will be able to adapt automatically to such changes thanks to
what's being done in this commit.

Reported-by: Justin Prysby
Discussion: https://postgr.es/m/20220922033716.GL31833@telsasoft.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/18ac08f0b42de3cf35f07199c9f482746c8b12c0

Modified Files
--------------
doc/src/sgml/protocol.sgml | 6 ++++--
src/common/compression.c   | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Use min/max bounds defined by Zstd for compression level
@ 2022-09-22 11:04 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2022-09-22 11:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use min/max bounds defined by Zstd for compression level

The bounds hardcoded in compression.c since ffd5365 (minimum at 1 and
maximum at 22) do not match the reality of what zstd is able to
handle, these values being available via ZSTD_maxCLevel() and
ZSTD_minCLevel() at run-time.  The maximum of 22 is actually correct
in recent versions, but the minimum was not as the library can go down
to -131720 by design.  This commit changes the code to use the run-time
values in the code instead of some hardcoded ones.

Zstd seems to assume that these bounds could change in the future, and
Postgres will be able to adapt automatically to such changes thanks to
what's being done in this commit.

Reported-by: Justin Prysby
Discussion: https://postgr.es/m/20220922033716.GL31833@telsasoft.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ade925e1693a595ef1c278583fa699ca6fc1ff45

Modified Files
--------------
doc/src/sgml/protocol.sgml | 6 ++++--
src/common/compression.c   | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-09-22 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 11:04 pgsql: Use min/max bounds defined by Zstd for compression level Michael Paquier <michael@paquier.xyz>
2022-09-22 11:04 pgsql: Use min/max bounds defined by Zstd for compression level Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox