Re: units in postgresql.conf comments - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: units in postgresql.conf comments
Date
Msg-id 51A6F92D.6020701@vmware.com
Whole thread Raw
In response to Re: units in postgresql.conf comments  (Bruce Momjian <bruce@momjian.us>)
Responses Re: units in postgresql.conf comments  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-hackers
On 30.05.2013 06:43, Bruce Momjian wrote:
> On Wed, May 29, 2013 at 09:59:10PM -0400, Peter Eisentraut wrote:
>> I think these sort of entries don't make much sense:
>>
>> #wal_sender_timeout = 60s      # in milliseconds; 0 disables
>>
>> I think we should remove units from the comments when it's clear from
>> the name or the default value that time units are accepted.
>
> We are documenting what happens when there are no units.  Are people are
> going to change '60s' to '50' and assume that is '50s'?  Hopefully not.
> I do like the clutter avoidance of removing the units from the comments.

We could make it mandatory to specify the unit in the value. Ie. throw 
an error on "wal_sender_timeout = 50":

ERROR: unit required for option "wal_sender_timeout"
HINT:  Valid units for this parameter are "ms", "s", "min", "h", and "d".

Then you wouldn't need a comment to explain what the unit of a naked 
value is. The only problem I see with that is backwards-compatibility. 
Old postgresql.conf files containing naked values would no longer work. 
But all you'd need to do is to add in the units, which would work on 
older versions too, and would be good for readability anyway.

- Heikki



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: all_visible replay aborting due to uninitialized pages
Next
From: Craig Ringer
Date:
Subject: Re: [PATCH] add --throttle to pgbench (submission 3)