pgsql: Ensure TOAST storage parameters have unsettable defaults. - Mailing list pgsql-committers

From Nathan Bossart
Subject pgsql: Ensure TOAST storage parameters have unsettable defaults.
Date
Msg-id E1wxSTK-00000001XIe-2910@gemulon.postgresql.org
Whole thread
List pgsql-committers
Ensure TOAST storage parameters have unsettable defaults.

A follow-up commit will teach autovacuum and manual VACUUM to fill
in a TOAST table's unset storage parameters from its main table's.
To be able to determine whether a parameter is set, it must default
to a value that users cannot set.  Of all the parameters that can
be set on TOAST tables, log_autovacuum_min_duration is the only one
that violates this rule.  This commit changes its default to -2 so
that we can tell whether it is set.  This shouldn't produce any
user-visible behavior changes.

While at it, add assertions to ensure all storage parameters that
can be set on TOAST tables continue to follow this rule.

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Sami Imseih <samimseih@gmail.com>
Reviewed-by: Greg Burd <greg@burd.me>
Tested-by: solai v <solai.cdac@gmail.com>
Discussion: https://postgr.es/m/aFRxC1W_kZU9OjJ9%40nathan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/63979e5bea14c533dadc8f44cee0ec7a2899ccf5

Modified Files
--------------
src/backend/access/common/reloptions.c | 76 +++++++++++++++++++++++++++++++++-
src/backend/postmaster/autovacuum.c    |  2 +-
2 files changed, 76 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: David Rowley
Date:
Subject: pgsql: Reduce memory overheads for storing a Memoize tuple
Next
From: David Rowley
Date:
Subject: pgsql: Fix incorrect nmembers calculation in test_bitmapset