Re: [PATCH] Cleanup of GUC units code

From: Hannu Krosing <hannu(at)krosing(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, Marko Kreen <markokr(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Cleanup of GUC units code
Date: 2008-09-03 09:23:58
Message-ID: 1220433838.7004.19.camel@huvostro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2008-09-02 at 16:50 +0300, Peter Eisentraut wrote:
> Gregory Stark wrote:
> > Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-09-03 11:20:30 Re: Question regarding the database page layout.
Previous Message Marko Kreen 2008-09-03 09:18:33 Re: [PATCH] Cleanup of GUC units code