]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Allow Boolean reloptions to have ternary values
authorÁlvaro Herrera <alvherre@kurilemu.de>
Wed, 21 Jan 2026 19:06:01 +0000 (20:06 +0100)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Wed, 21 Jan 2026 19:06:01 +0000 (20:06 +0100)
commit4d6a66f675815a5d40a650d4dcfb5ddb89c6ad2f
tree37bc0eae0dae62dc4ed2011b3e2bc0b3cc78d5a2
parentcec5fe0d1e192b3b0005063011f113ac99f6908c
Allow Boolean reloptions to have ternary values

From the user's point of view these are just Boolean values; from the
implementation side we can now distinguish an option that hasn't been
set.  Reimplement the vacuum_truncate reloption using this type.

This could also be used for reloptions vacuum_index_cleanup and
buffering, but those additionally need a per-option "alias" for the
state where the variable is unset (currently the value "auto").

Author: Nikolay Shaplov <dhyan@nataraj.su>
Reviewed-by: Timur Magomedov <t.magomedov@postgrespro.ru>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://postgr.es/m/3474141.usfYGdeWWP@thinkpad-pgpro
12 files changed:
src/backend/access/common/reloptions.c
src/backend/commands/vacuum.c
src/include/access/reloptions.h
src/include/postgres.h
src/include/utils/rel.h
src/test/modules/dummy_index_am/README
src/test/modules/dummy_index_am/dummy_index_am.c
src/test/modules/dummy_index_am/expected/reloptions.out
src/test/modules/dummy_index_am/sql/reloptions.sql
src/test/regress/expected/reloptions.out
src/test/regress/sql/reloptions.sql
src/tools/pgindent/typedefs.list