Re: units in postgresql.conf comments

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: units in postgresql.conf comments
Дата
Msg-id 51A6F92D.6020701@vmware.com
обсуждение исходный текст
Ответ на Re: units in postgresql.conf comments  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: units in postgresql.conf comments
Список 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 по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: all_visible replay aborting due to uninitialized pages
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: [PATCH] add --throttle to pgbench (submission 3)