pgsql: Show a sensible value in pg_settings.unit for GUC_UNIT_XSEGS var

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Show a sensible value in pg_settings.unit for GUC_UNIT_XSEGS var
Date: 2016-10-03 20:40:41
Message-ID: E1brA2T-0005Xh-Jg@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Show a sensible value in pg_settings.unit for GUC_UNIT_XSEGS variables.

Commit 88e982302 invented GUC_UNIT_XSEGS for min_wal_size and max_wal_size,
but neglected to make it display sensibly in pg_settings.unit (by adding a
case to the switch in GetConfigOptionByNum). Fix that, and adjust said
switch to throw a run-time error the next time somebody forgets.

In passing, avoid using a static buffer for the output string --- the rest
of this function pstrdup's from a local buffer, and I see no very good
reason why the units code should do it differently and less safely.

Per report from Otar Shavadze. Back-patch to 9.5 where the new unit type
was added.

Report: <CAG-jOyA=iNFhN+yB4vfvqh688B7Tr5SArbYcFUAjZi=0Exp-Lg(at)mail(dot)gmail(dot)com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6bc811c992a804bdb8d228ce0be9f0a8e7198df6

Modified Files
--------------
src/backend/utils/misc/guc.c | 20 ++++++++++++++------
src/include/utils/guc.h | 4 ++--
2 files changed, 16 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-10-04 02:27:21 pgsql: Convert contrib/hstore_plpython to not use direct linking to oth
Previous Message Stephen Frost 2016-10-03 20:24:12 pgsql: Fix RLS with COPY (col1, col2) FROM tab