Fractions in GUC variables - Mailing list pgsql-hackers

From John Gorman
Subject Fractions in GUC variables
Date
Msg-id CALkS6B824HNOJzyXikSNpXnknGcPjb20jO4p1ByBQRKGYJPp_A@mail.gmail.com
Whole thread Raw
Responses Re: Fractions in GUC variables  (Michael Paquier <michael.paquier@gmail.com>)
Re: Fractions in GUC variables  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Re: Fractions in GUC variables  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers

This patch implements the first wiki/Todo Configuration Files item "Consider normalizing fractions in postgresql.conf, perhaps using '%'".

The "Fractions in GUC variables" discussion is here.


This patch implements expressing GUC variables as percents in postgresql.conf.

autovacuum_vacuum_scale_factor = 20%   # percent of table size before vacuum
autovacuum_analyze_scale_factor = 10%  # percent of table size before analyze

As you can see the postgresql.conf file and the documentation read more naturally.  I added a regression test to guc.sql. The sql interface also accepts both numeric and percent forms although the percent form must be quoted because '%' is an operator.

show cursor_tuple_fraction; --> 10%
set cursor_tuple_fraction = .15; --> 15%
set cursor_tuple_fraction = '33%'; --> 33%

I tagged four configuration variables to display as percents.

The attached patch applies cleanly against master and passes all regression tests including two new tests in guc.sql.

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: alter user set local_preload_libraries.
Next
From: Josh Berkus
Date:
Subject: Re: Fractions in GUC variables