Re: Units in postgresql.conf - Mailing list pgsql-hackers

From Jonah H. Harris
Subject Re: Units in postgresql.conf
Date
Msg-id 36e682920607200504i403464f6u3eb34df96065f13e@mail.gmail.com
Whole thread Raw
In response to Units in postgresql.conf  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Units in postgresql.conf  (Darcy Buskermolen <darcy@wavefire.com>)
List pgsql-hackers
On 7/20/06, Peter Eisentraut <peter_e@gmx.net> wrote:
> I think it would be useful to allow units to be added to these settings, for
> example
>
> shared_buffers = 1000kB
> checkpoint_warning = 30s
>
> This would also allow
>
> shared_buffers = 512MB
>
> which is a bit cumbersome to calculate right now (you'd need = 65536).
>
> I haven't thought yet how to parse or implement this, but would people find
> this useful?

I agree, a lot of newbies have issues with the configuration file.  I
have a tiny bit of code (about 20 lines I think) that will handle K,
M, and G suffixes for memory.  It would be equally easy to add S for
seconds, ....

In my code, if no suffix existed, I'd just revert to the default
behavior.  This is probably what we'd want to do in PostgreSQL as
well.

The only issue in PostgreSQL is knowing what the unit conversion and
scaling factor is for each parameter (8K, 1K, milliseconds, etc);
though, this wouldn't be hard to add at all.

-- 
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation            | fax: 732.331.1301
33 Wood Ave S, 2nd Floor            | jharris@enterprisedb.com
Iselin, New Jersey 08830            | http://www.enterprisedb.com/


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Units in postgresql.conf
Next
From: Gavin Sherry
Date:
Subject: Re: Units in postgresql.conf