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 1220462282.12162.57.camel@huvostro
Whole thread Raw
In response to Re: [PATCH] Cleanup of GUC units code  (Joshua Drake <jd@commandprompt.com>)
Responses Re: [PATCH] Cleanup of GUC units code
List pgsql-hackers
On Wed, 2008-09-03 at 09:10 -0700, Joshua Drake wrote:

> If someone doesn't know the difference between Mb and MB on a
> production system, I would not want them anywhere near any instance of
> a production system.

I for one can make the difference, once I can zen that we are in a
domain, where Mbit makes sense. For me it does not make any sense to
define shared_buffer in Mbit's.

> If we are going to make sweeping statements (anyone on this thread)
> about user-hostile and most people, then we better define what those
> mean. 

Not user-hostile but rather hostile to an overworked DBA, who tries to
change some .conf param from 1MB to 512KB at 3AM to save an overloaded
server and then suddenly the server won't start anymore.

> This whole argument about making something easier (and incorrect)
> for someone who doesn't exist and has not been defined.

I still don't get in what non-academic way it would be incorrect to
spell kilobytes as kb or KB or megabytes as mb ?

Do you have any standard source where it specifies one use and forbids
the other ?

We are not correct according to SI (where k = 1000) nor IEC which
specifies Ki for 1024.

> I would be hung on this list if I made a similar argument about any
> other feature.

Its all about making it easier, not incorrect. 

It may be perhaps "incorrect" in some strictly academic sense, maybe
some article submission guidelines or such.

> > > I don't think we should encourage in any way for users to do the
> > > wrong thing.
> > 
> > Can you see any scenario where accepting case insensitive units does
> > more damage than just ignoring the conf line with "incorrect" casing ?
> 
> Generally speaking, no I can't think of any damage that could be done
> from mixed casing. Especially since we would only accept certain
> possibilities, e.g; Mb would equal MB.
> 
> It just strikes me as really bad that a project that prides itself on
> "doing it right" is willing to make this type of sacrifice. This isn't
> about usability. 

It is all about usability. Not accepting popular spellings of common
units seems to me as unnecessary nit-picking , similar to if we
required _exactly_ one space on either side on = in SET statements.

And we are already "incorrect" by allowing both '' and "" around the
value, the latter would usually imply an identifier :P

hannu=# set effective_cache_size = '132MB';
SET
hannu=# set effective_cache_size = "132MB";
SET

Maybe we should change this too if we want to champion the "right way"?

> This is about doing it wrong and actively encouraging
> our users that "wrong is ok". It could also misinform the user about
> what the meaning of the value means.

You could issue a warning, something like 

"Warning: KB is not a spelling endorsed by PostgeSQL Global Development
Group, in future please use kB, a spelling that many of us feel to be
the only valid one and others don't think important enough to argue with
them."

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




pgsql-hackers by date:

Previous
From: pgsql@mohawksoft.com
Date:
Subject: Re: Function call order dependency
Next
From: Josh Berkus
Date:
Subject: Commitfest has started, y'all