Refactor non-supported compression error message in toast_compression.c
authorMichael Paquier <michael@paquier.xyz>
Wed, 16 Jul 2025 02:59:22 +0000 (11:59 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 16 Jul 2025 02:59:22 +0000 (11:59 +0900)
commit1dbe6f76677c26096518998fdc72dab771a98913
tree0d0f5c3ceebffec0fdf2daebc09754ac6cff0906
parentb8341ae856f239c6d84c738e516267e890969d8a
Refactor non-supported compression error message in toast_compression.c

This code used a NO_LZ4_SUPPORT() macro to issue an error in the code
paths where LZ4 [de]compression is attempted but the build does not
support it.  This commit refactors the code to use a more flexible error
message so as it can be used for other compression methods, where the
method is given in input of macro.

Extracted from a larger patch by the same author.

Author: Nikhil Kumar Veldanda <veldanda.nikhilkumar17@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Discussion: http://postgr.es/m/CAFAfj_HX84EK4hyRYw50AOHOcdVi-+FFwAAPo7JHx4aShCvunQ@mail.gmail.com
src/backend/access/common/toast_compression.c