]> granicus.if.org Git - postgresql/commit
Show a sensible value in pg_settings.unit for GUC_UNIT_XSEGS variables.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 3 Oct 2016 20:40:06 +0000 (16:40 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 3 Oct 2016 20:40:27 +0000 (16:40 -0400)
commitf50fa46cca9a1e5bfd517f7f1d979ef4db55ce03
tree5419b3abb5839fbcf453700835ef02fb5ffd6784
parent647a86e374d2eb01d8cdda2fc759a770b38cc232
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@mail.gmail.com>
src/backend/utils/misc/guc.c
src/include/utils/guc.h