It seems everyone likes the units, so here are some details of the 
implementation I have prepared.

Memory units are kB, MB, GB.  The factor is 1024.

Time units are ms, s, min, h, d.

I intentionally did not support microseconds because that would make the 
coding extremely overflow-risky, and the only candidate commit_delay 
isn't used much.  This can be added once int64 support is required.  
For similar reasons, the unit "byte" is not supported.

The full list of candidates then is:

post_auth_delay                 s
deadlock_timeout                ms
vacuum_cost_delay               ms
autovacuum_vacuum_cost_delay    ms
statement_timeout               ms
authentication_timeout          s
pre_auth_delay                  s
checkpoint_timeout              s
log_min_duration_statement      ms
bgwriter_delay                  ms
log_rotation_age                min
autovacuum_naptime              s
tcp_keepalives_idle             s
tcp_keepalives_interval         s

shared_buffers                  8kB
temp_buffers                    8kB
work_mem                        kB
maintenance_work_mem            kB
log_rotation_size               kB
effective_cache_size            kB (pending switch to int)

Units can be specified with or without space after the number.  In the 
configuration file, writing a space after the number would require 
quoting the entire the value, without a space not.  With SET of course 
you have to quote anyway.

If you don't specify any unit, you get the behavior from before.

Output from SHOW uses the largest unit that fits as long as the number 
is an integer.  (I guess you could change that later to some more 
complex scheme, but I feel that this is better than what we have.)  If 
the value is zero or negative, no unit is used.  (-1 sometimes 
means "off".)

The error messages complaining about range violations and similar things 
should perhaps also be changed to use units.

I'm a bit afraid of removing all references to the true internal units 
of these parameters, because before long someone will see a message "I 
don't like value 123" and they won't know what unit it is.  We'll have 
to deal with those as we go along I guess.

Peter Eisentraut

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to