Tidy up more loose ends related to configurable TOAST compression.
authorRobert Haas <[email protected]>
Wed, 24 Mar 2021 16:36:08 +0000 (12:36 -0400)
committerRobert Haas <[email protected]>
Wed, 24 Mar 2021 16:36:08 +0000 (12:36 -0400)
commite5595de03ec6ce60afde980ae05e9353a1501fdf
tree39b58af0b1a187f8b18f33c2e9716e605c3c3f6a
parent49ab61f0bdc93984a8d36b602f6f2a15f09ebcc7
Tidy up more loose ends related to configurable TOAST compression.

Change the default_toast_compression GUC to be an enum rather than
a string. Earlier, uncommitted versions of the patch supported using
CREATE ACCESS METHOD to add new compression methods to a running
system, but that idea was dropped before commit. So, we can simplify
the GUC handling as well, which has the nice side effect of improving
the error messages.

While updating the documentation to reflect the new GUC type, also
move it back to the right place in the list. I moved this while
revising what became commit 24f0e395ac5892cd12e8914646fe921fac5ba23d,
but apparently the intended ordering is "alphabetical" rather than
"whatever Robert thinks looks nice."

Rejigger things to avoid having access/toast_compression.h depend on
utils/guc.h, so that we don't end up with every file that includes
it also depending on something largely unrelated. Move a few
inline functions back into the C source file partly to help reduce
dependencies and partly just to avoid clutter. A few very minor
cosmetic fixes.

Original patch by Justin Pryzby, but very heavily edited by me,
and reverse reviewed by him and also reviewed by by Tom Lane.

Discussion: http://postgr.es/m/CA+TgmoYp=GT_ztUCeZg2i4hkHAQv8o=-nVJ1-TKWTG1zQOmOpg@mail.gmail.com
doc/src/sgml/config.sgml
src/backend/access/common/toast_compression.c
src/backend/utils/misc/guc.c
src/include/access/toast_compression.h
src/test/regress/expected/compression.out
src/test/regress/expected/compression_1.out