pgsql: Allow Boolean reloptions to have ternary values - Mailing list pgsql-committers

From Álvaro Herrera
Subject pgsql: Allow Boolean reloptions to have ternary values
Date
Msg-id E1vidYa-001qhJ-11@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

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(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Remove useless flag PVC_INCLUDE_CONVERTROWTYPES.
Next
From: Tom Lane
Date:
Subject: pgsql: Force standard_conforming_strings to always be ON.