Allow Boolean reloptions to have ternary values
Álvaro Herrera <alvherre@kurilemu.de>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/common/reloptions.c | modified | +112 −26 |
| src/backend/commands/vacuum.c | modified | +2 −2 |
| src/include/access/reloptions.h | modified | +13 −13 |
| src/include/postgres.h | modified | +14 −0 |
| src/include/utils/rel.h | modified | +1 −2 |
| src/test/modules/dummy_index_am/dummy_index_am.c | modified | +36 −19 |
| src/test/modules/dummy_index_am/expected/reloptions.out | modified | +22 −2 |
| src/test/modules/dummy_index_am/README | modified | +1 −1 |
| src/test/modules/dummy_index_am/sql/reloptions.sql | modified | +10 −0 |
| src/test/regress/expected/reloptions.out | modified | +18 −0 |
| src/test/regress/sql/reloptions.sql | modified | +11 −0 |
| src/tools/pgindent/typedefs.list | modified | +2 −0 |
Discussion
- [PATCH] trenary reloption type 10 messages · 2025-08-31 → 2026-05-10