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 <[email protected]>
Reviewed-by: Timur Magomedov <[email protected]>
Reviewed-by: Nathan Bossart <[email protected]>
Discussion: https://postgr.es/m/3474141.usfYGdeWWP@thinkpad-pgpro

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4d6a66f675815a5d40a650d4dcfb5ddb89c6ad2f

Modified Files
--------------
src/backend/access/common/reloptions.c             | 138 +++++++++++++++++----
src/backend/commands/vacuum.c                      |   4 +-
src/include/access/reloptions.h                    |  26 ++--
src/include/postgres.h                             |  14 +++
src/include/utils/rel.h                            |   3 +-
src/test/modules/dummy_index_am/README             |   2 +-
src/test/modules/dummy_index_am/dummy_index_am.c   |  55 +++++---
.../modules/dummy_index_am/expected/reloptions.out |  24 +++-
src/test/modules/dummy_index_am/sql/reloptions.sql |  10 ++
src/test/regress/expected/reloptions.out           |  18 +++
src/test/regress/sql/reloptions.sql                |  11 ++
src/tools/pgindent/typedefs.list                   |   2 +
12 files changed, 242 insertions(+), 65 deletions(-)

Reply via email to