Peter Eisentraut wrote:
One frequent source of confusion are the different units that the parameters in postgresql.conf use. shared_buffers is in 8 kB, work_mem is in 1 kB; bgwriter_delay is in milliseconds, checkpoint_warning is in seconds. Obviously, we can't change that without inconveniencing a lot of users.

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?

It is good idea. I going to implement this. There is some proposal:

Time units is easy:
1h = 60min = 3600s = 3600000ms

Memory units:
What kind of unit prefix will we use for memory? 1kB=1000B and 1kiBi=1024B or 1kB=1024kB. See for detail. I suggest use IEC standard convention. By my opinion it is much better.

And there are some other questions:
1) will be unit required? What will be default unit for value without unit?

I suggest mandatory unit avoid the problem with unclear default value.

2) Each internal representation of setting use different unit. Shell I convert this representation to milliseconds and bytes? I think it is not good idea. It should generate some overflow. I suggest to recompute value and round it to integer.


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to