Re: units in postgresql.conf comments

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: units in postgresql.conf comments
Date: 2013-05-30 07:01:01
Message-ID: 51A6F92D.6020701@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-05-30 07:10:06 Re: [PATCH] add --throttle to pgbench (submission 3)
Previous Message Andres Freund 2013-05-30 06:29:31 Re: all_visible replay aborting due to uninitialized pages