Re: [PATCH] Cleanup of GUC units code - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: [PATCH] Cleanup of GUC units code
Date
Msg-id 1220433838.7004.19.camel@huvostro
Whole thread Raw
In response to Re: [PATCH] Cleanup of GUC units code  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: [PATCH] Cleanup of GUC units code  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-hackers
On Tue, 2008-09-02 at 16:50 +0300, Peter Eisentraut wrote:
> Gregory Stark wrote:
> > Peter Eisentraut <peter_e@gmx.net> writes:
> > 
> >> Marko Kreen wrote:
> >>> In the meantime, here is simple patch for case-insensivity.
> >> You might be able to talk me into accepting various unambiguous, common
> >> alternative spellings of various units.  But for instance allowing MB and Mb to
> >> mean the same thing is insane.
> > 
> > Because you think some user will be trying to specify their shared_buffers in
> > bits?

If somebody wants then somebody can still claim that the units are
wrong, as SI specifies 1k = 1000 and 1M=1000000, etc

The binary "should" use IEC multipliers for kibi-, mebi-, tebi-, gibi-,
etc.

http://searchstorage.techtarget.com/sDefinition/0,,sid5_gci825099,00.html

So we could beat "correctness" into DBA-s by forcing them to write KiB
MiB and so on for things that they have always written kb and mb (unless
they are communication engineers, in which case they may be used to
writing these as kB and MB)


> My concern is that this information does not stay in the configuration 
> files.  It will invariably leak out into whitepapers, presentations, 
> product documentation, and before long there will be confusion about why 
> you can't stuff N Mb over an N Mb connection.  

You can't even put N Mbits of data in one sec over N Mbits/sec
connection as there is some overhead from all protocol levels.

Clueless people will also be confused about why they can't fit 1Mbyte of
CVS data into a 1Mbyte database file or why you can't store 1024 MB of
data on a 1GB disk.

> I am not making this up.

Is there anything in conf files that can be reasonably specified in
bits ?

> Mb does not add any typing ease (as "KB" might) or readability (as "sec" 
>    might), and there is no respectable source that will claim it is an 
> acceptable alias for MB.

Are you really afraid that someone would want to use mb to mean
millibits ?

As SQL is generally case insensitive, it is quite surprising to most
people that GUC units are not.

-----------------
Hannu





pgsql-hackers by date:

Previous
From: "Marko Kreen"
Date:
Subject: Re: [PATCH] Cleanup of GUC units code
Next
From: Gregory Stark
Date:
Subject: Re: Question regarding the database page layout.