Re: GUC with units, details - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Re: GUC with units, details
Date
Msg-id 44C72437.6070403@tada.se
Whole thread Raw
In response to Re: GUC with units, details  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs wrote:
> don't ever need to say that K = 1000, AFAICS. I think we are safe to
> assume that 
> 
>     kB = KB = kb = Kb = 1024 bytes
> 
>     mB = MB = mb = Mb = 1024 * 1024 bytes
> 
>     gB = GB = gb = Gb = 1024 * 1024 * 1024 bytes
> 
> There's no value in forcing the use of specific case and it will be just
> confusing for people.
> 
It's fairly common to use 'b' for 'bits' and 'B' for 'bytes'. My suggestion would be to be 
much more restrictive and avoid small caps:

KB = 1024 bytes
MB = 1024 KB
GB = 1024 KB
TB = 1024 GB

Although I don't expect to see bit-rates or fractions ('m' == 'milli') in GUC, it might be 
good to use consistent units everywhere.

Regards,
Thomas Hallgren


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: GUC with units, details
Next
From: Joachim Wieland
Date:
Subject: Re: [PATCHES] Time zone definitions to config files