Re: effective_cache_size vs units

Lists: pgsql-hackers
From: Magnus Hagander <magnus(at)hagander(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: effective_cache_size vs units
Date: 2006-12-18 20:45:43
Message-ID: 4586FDF7.5050106@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Is there any special reason why I can't use "Mb" and "Gb" and such for
effective_cache_size, the way I can for say shared_buffers?

//Magnus


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: effective_cache_size vs units
Date: 2006-12-18 21:08:31
Message-ID: 200612182208.32184.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander wrote:
> Is there any special reason why I can't use "Mb" and "Gb" and such
> for effective_cache_size, the way I can for say shared_buffers?

You can't use "Mb" or "Gb" for shared_buffers either, because those are
not accepted units.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: effective_cache_size vs units
Date: 2006-12-18 21:15:13
Message-ID: 1166476513.28377.12.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, 2006-12-18 at 22:08 +0100, Peter Eisentraut wrote:
> Magnus Hagander wrote:
> > Is there any special reason why I can't use "Mb" and "Gb" and such
> > for effective_cache_size, the way I can for say shared_buffers?
>
> You can't use "Mb" or "Gb" for shared_buffers either, because those are
> not accepted units.

Magnus,

Here is a link that may help:
http://www.postgresql.org/docs/8.2/static/config-setting.html

It looks like it is very pedantic about the input it can receive.

Sincerely,

Joshua D. Drake

>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-18 21:26:56
Message-ID: 458707A0.4080701@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Magnus Hagander wrote:
>> Is there any special reason why I can't use "Mb" and "Gb" and such
>> for effective_cache_size, the way I can for say shared_buffers?
>
> You can't use "Mb" or "Gb" for shared_buffers either, because those are
> not accepted units.
>

Oh, you mean MB vs Mb. Man, it had to be that simple :)

Sorry about the noise.

//Magnus


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 04:46:55
Message-ID: 11511.1166503615@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> Oh, you mean MB vs Mb. Man, it had to be that simple :)

ISTM we had discussed whether guc.c should accept units strings in
a case-insensitive manner, and the forces of pedantry won the first
round. Shall we reopen that argument?

regards, tom lane


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 04:56:22
Message-ID: 1166504182.22487.36.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, 2006-12-18 at 23:46 -0500, Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > Oh, you mean MB vs Mb. Man, it had to be that simple :)
>
> ISTM we had discussed whether guc.c should accept units strings in
> a case-insensitive manner, and the forces of pedantry won the first
> round. Shall we reopen that argument?

I don't think that anyone is going to think, oh I am using 1000 Mega Bit
of ram. Mb == MB in this case. That being said, it is documented and I
don't know that it makes that much difference as long as the
documentation is clear.

Hmm perhaps perhaps a quick statement to the effect of what is legal in
the postgresql.conf? E.g;

#
# When setting memory parameters you may used a shortened sytanx e.g.,
# 1024MB or 1GB is 1 Gigabyte of ram. Note that MB/GB is capitalized.
#

Sincerely,

Joshua D. Drake

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

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 08:36:42
Message-ID: 20061219083642.GB9627@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Dec 18, 2006 at 08:56:22PM -0800, Joshua D. Drake wrote:
> On Mon, 2006-12-18 at 23:46 -0500, Tom Lane wrote:
> > Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > > Oh, you mean MB vs Mb. Man, it had to be that simple :)
> >
> > ISTM we had discussed whether guc.c should accept units strings in
> > a case-insensitive manner, and the forces of pedantry won the first
> > round. Shall we reopen that argument?
>
> I don't think that anyone is going to think, oh I am using 1000 Mega Bit
> of ram. Mb == MB in this case. That being said, it is documented and I
> don't know that it makes that much difference as long as the
> documentation is clear.

Is it possible to add an error hint to the message? Along the line of
"HINT: Did you perhaps get your casing wrong" (with better wording, of
course).

//Magnus


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 09:01:05
Message-ID: 200612191001.06889.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander wrote:
> Is it possible to add an error hint to the message? Along the line of
> "HINT: Did you perhaps get your casing wrong" (with better wording,
> of course).

Or how about we just make everything case-insensitive -- but
case-preserving! -- on Windows only?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 09:05:31
Message-ID: 20061219090531.GF9627@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Dec 19, 2006 at 10:01:05AM +0100, Peter Eisentraut wrote:
> Magnus Hagander wrote:
> > Is it possible to add an error hint to the message? Along the line of
> > "HINT: Did you perhaps get your casing wrong" (with better wording,
> > of course).
>
> Or how about we just make everything case-insensitive -- but
> case-preserving! -- on Windows only?

Wouldn't help me one bit, I had this problem on the install for
search.postgresql.org, which runs on Ubuntu Linux.

//Magnus


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 21:32:38
Message-ID: 1166563958.22487.132.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 2006-12-19 at 10:01 +0100, Peter Eisentraut wrote:
> Magnus Hagander wrote:
> > Is it possible to add an error hint to the message? Along the line of
> > "HINT: Did you perhaps get your casing wrong" (with better wording,
> > of course).
>
> Or how about we just make everything case-insensitive -- but
> case-preserving! -- on Windows only?

Or we could simply add a helpful line to the postgresql.conf.

Sincerely,

Joshua D. Drake

>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 21:39:06
Message-ID: 1166564346.22487.139.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 2006-12-19 at 13:32 -0800, Joshua D. Drake wrote:
> On Tue, 2006-12-19 at 10:01 +0100, Peter Eisentraut wrote:
> > Magnus Hagander wrote:
> > > Is it possible to add an error hint to the message? Along the line of
> > > "HINT: Did you perhaps get your casing wrong" (with better wording,
> > > of course).
> >
> > Or how about we just make everything case-insensitive -- but
> > case-preserving! -- on Windows only?
>
> Or we could simply add a helpful line to the postgresql.conf.

Index: postgresql.conf.sample
===================================================================
RCS
file: /projects/cvsroot/pgsql/src/backend/utils/misc/postgresql.conf.sample,v
retrieving revision 1.199
diff -c -r1.199 postgresql.conf.sample
*** postgresql.conf.sample 21 Nov 2006 01:23:37 -0000 1.199
--- postgresql.conf.sample 19 Dec 2006 21:36:28 -0000
***************
*** 24,29 ****
--- 24,33 ----
# settings, which are marked below, require a server shutdown and
restart
# to take effect.

+ #
+ # Any memory setting may use a shortened notation such as 1024MB or
1GB.
+ # Please take note of the case next to the unit size.
+ #

#---------------------------------------------------------------------------
# FILE LOCATIONS

>
> Sincerely,
>
> Joshua D. Drake
>
>
> >
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 21:47:58
Message-ID: 200612192147.kBJLlwh13619@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Joshua D. Drake wrote:
> On Tue, 2006-12-19 at 10:01 +0100, Peter Eisentraut wrote:
> > Magnus Hagander wrote:
> > > Is it possible to add an error hint to the message? Along the line of
> > > "HINT: Did you perhaps get your casing wrong" (with better wording,
> > > of course).
> >
> > Or how about we just make everything case-insensitive -- but
> > case-preserving! -- on Windows only?
>
> Or we could simply add a helpful line to the postgresql.conf.

Looking at the documentation I see:

(possibly different) unit can also be specified explicitly. Valid
memory units are <literal>kB</literal> (kilobytes),
<literal>MB</literal> (megabytes), and <literal>GB</literal>
(gigabytes); valid time units are <literal>ms</literal>
(milliseconds), <literal>s</literal> (seconds),
<literal>min</literal> (minutes), <literal>h</literal> (hours),
and <literal>d</literal> (days). Note that the multiplier for
memory units is 1024, not 1000.

The only value to being case-sensitive in this area is to allow
upper/lower case with different meanings, but I don't see us using that,
so why do we bother caring about the case?

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 21:51:28
Message-ID: 1166565088.22487.146.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 2006-12-19 at 16:47 -0500, Bruce Momjian wrote:
> Joshua D. Drake wrote:
> > On Tue, 2006-12-19 at 10:01 +0100, Peter Eisentraut wrote:
> > > Magnus Hagander wrote:
> > > > Is it possible to add an error hint to the message? Along the line of
> > > > "HINT: Did you perhaps get your casing wrong" (with better wording,
> > > > of course).
> > >
> > > Or how about we just make everything case-insensitive -- but
> > > case-preserving! -- on Windows only?
> >
> > Or we could simply add a helpful line to the postgresql.conf.
>
> Looking at the documentation I see:
>
> (possibly different) unit can also be specified explicitly. Valid
> memory units are <literal>kB</literal> (kilobytes),
> <literal>MB</literal> (megabytes), and <literal>GB</literal>
> (gigabytes); valid time units are <literal>ms</literal>
> (milliseconds), <literal>s</literal> (seconds),
> <literal>min</literal> (minutes), <literal>h</literal> (hours),
> and <literal>d</literal> (days). Note that the multiplier for
> memory units is 1024, not 1000.
>
> The only value to being case-sensitive in this area is to allow
> upper/lower case with different meanings, but I don't see us using that,
> so why do we bother caring about the case?

Because it is technically correct :).

Sincerely,

Joshua D. Drake

>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 21:59:49
Message-ID: 200612192259.50920.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Joshua D. Drake wrote:
> + #
> + # Any memory setting may use a shortened notation such as 1024MB or
> 1GB.
> + # Please take note of the case next to the unit size.
> + #

Well, if you add that, you should also list all the other valid units.
But it's quite redundant, because nearly all the parameters that take
units are already listed with units in the default file. (Which makes
Magnus's mistake all the more curios.)

In my mind, this is pretty silly. There is no reputable precedent
anywhere for variant capitalization in unit names. Next thing we point
out that zeros are significant in the interior of numbers, or what?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:08:47
Message-ID: 458862EF.4000109@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Joshua D. Drake wrote:
>> + #
>> + # Any memory setting may use a shortened notation such as 1024MB or
>> 1GB.
>> + # Please take note of the case next to the unit size.
>> + #
>
> Well, if you add that, you should also list all the other valid units.
> But it's quite redundant, because nearly all the parameters that take
> units are already listed with units in the default file. (Which makes
> Magnus's mistake all the more curios.)
>

The explanation is pretty simple. I was in a hurry to set it, just
opened the file up in vi, jumped to effective cache size, and set it. I
remembered that "hey, I can spec it in Mb now, I don't have to think,
brilliant", and just typed it in. Restarted pg and noticed it wouldn't
start...

Had I actually read through all the documentation before I did it, it
certainly wouldn't have been a problem. I doubt many users actually do
that, though. In most cases, I just assume they would just assume they
can't use units on it because the default value in the file doesn't have
units.

And frankly, this is the only case I can recall having seen when the
input is actually case sensitive between Mb and MB. Could be that I'm
not exposed to enough systems that take such input, but I can't imagine
there aren't others who would make the same mistake.

//Magnus


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:09:20
Message-ID: 1166566160.22487.149.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 2006-12-19 at 22:59 +0100, Peter Eisentraut wrote:
> Joshua D. Drake wrote:
> > + #
> > + # Any memory setting may use a shortened notation such as 1024MB or
> > 1GB.
> > + # Please take note of the case next to the unit size.
> > + #
>
> Well, if you add that, you should also list all the other valid units.

Why? It is clearly just an example.

> But it's quite redundant, because nearly all the parameters that take
> units are already listed with units in the default file. (Which makes
> Magnus's mistake all the more curios.)

Not really, most people I know don't even consider the difference
between MB and Mb... shoot most people think that 1000MB equals one
Gigabyte.

>
> In my mind, this is pretty silly. There is no reputable precedent
> anywhere for variant capitalization in unit names.

I am not suggestion variant capitalization. I am suggestion a simple
document patch to help eliminate what may not be obvious.

Sincerely,

Joshua D. Drake

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:10:22
Message-ID: 200612192310.23992.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> The only value to being case-sensitive in this area is to allow
> upper/lower case with different meanings, but I don't see us using
> that, so why do we bother caring about the case?

Because the units are what they are.

In broader terms, we may one day want to have other units or a
units-aware data type, so introducing incompatibilities now would be
unfortunate.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:12:03
Message-ID: 1166566323.22487.151.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> > In my mind, this is pretty silly. There is no reputable precedent
> > anywhere for variant capitalization in unit names.
>
> I am not suggestion variant capitalization. I am suggestion a simple
> document patch to help eliminate what may not be obvious.

Good lord... *suggesting*

Joshua D. Drake

> Sincerely,
>
> Joshua D. Drake
>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Magnus Hagander" <magnus(at)hagander(dot)net>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:12:34
Message-ID: 87bqlzk019.fsf@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> Oh, you mean MB vs Mb. Man, it had to be that simple :)
>
> ISTM we had discussed whether guc.c should accept units strings in
> a case-insensitive manner, and the forces of pedantry won the first
> round. Shall we reopen that argument?

Nope, I just checked back in the archive and that's not what happened. There
was an extended discussion about whether to force users to use the silly KiB,
MiB, etc units. Thankfully the pedants lost that round soundly.

There was no particular discussion about case sensitivity though Simon made
the case for user-friendly behaviour:

> I think we are safe assume to 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.

http://archives.postgresql.org/pgsql-hackers/2006-07/msg01253.php

And Jim Nasby said something similar:

> Forcing people to use a specific casing scheme is just going to lead to
> confusion and user frustration. If there's not a very solid *functional*
> argument for it, we shouldn't do it. Wanting to enforce a convention that
> people rarely use isn't a good reason.

http://archives.postgresql.org/pgsql-hackers/2006-07/msg01355.php

There was a lone comment from Thomas Hallgren in favour of case sensitivity in
the name of consistency. But Nasby's comment was directly in response and
nobody else piped up after that.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com


From: Kenneth Marshall <ktm(at)it(dot)is(dot)rice(dot)edu>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:20:58
Message-ID: 20061219222058.GX27765@it.is.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Dec 19, 2006 at 10:12:34PM +0000, Gregory Stark wrote:
>
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> > Magnus Hagander <magnus(at)hagander(dot)net> writes:
> >> Oh, you mean MB vs Mb. Man, it had to be that simple :)
> >
> > ISTM we had discussed whether guc.c should accept units strings in
> > a case-insensitive manner, and the forces of pedantry won the first
> > round. Shall we reopen that argument?
>
> Nope, I just checked back in the archive and that's not what happened. There
> was an extended discussion about whether to force users to use the silly KiB,
> MiB, etc units. Thankfully the pedants lost that round soundly.
>
> There was no particular discussion about case sensitivity though Simon made
> the case for user-friendly behaviour:
>
> > I think we are safe assume to 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.
>
> http://archives.postgresql.org/pgsql-hackers/2006-07/msg01253.php
>
> And Jim Nasby said something similar:
>
> > Forcing people to use a specific casing scheme is just going to lead to
> > confusion and user frustration. If there's not a very solid *functional*
> > argument for it, we shouldn't do it. Wanting to enforce a convention that
> > people rarely use isn't a good reason.
>
> http://archives.postgresql.org/pgsql-hackers/2006-07/msg01355.php
>
> There was a lone comment from Thomas Hallgren in favour of case sensitivity in
> the name of consistency. But Nasby's comment was directly in response and
> nobody else piped up after that.
>

My one comment is that a little 'b' is used to indicate bits normally
and a capital 'B' is used to indicate bytes. So
kb = '1024 bits'
kB = '1024 bytes'
...

I do think that whether or not the k/m/g is upper case or lower case
is immaterial.

Ken
> --
> Gregory Stark
> EnterpriseDB http://www.enterprisedb.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:37:00
Message-ID: 200612192337.02401.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander wrote:
> In most cases, I just assume they would just assume
> they can't use units on it because the default value in the file
> doesn't have units.

But the default value *does* have units.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:39:34
Message-ID: 45886A26.4000607@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Magnus Hagander wrote:
>> In most cases, I just assume they would just assume
>> they can't use units on it because the default value in the file
>> doesn't have units.
>
> But the default value *does* have units.
>
It does? Didn't in my file. I must've overwritten it with a config file
from some earlier beta (or snapshot) that didn't have it or so - my
default value certainly didn't have it ;-)

//Magnus


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:43:04
Message-ID: 1166568184.22487.156.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 2006-12-19 at 23:39 +0100, Magnus Hagander wrote:
> Peter Eisentraut wrote:
> > Magnus Hagander wrote:
> >> In most cases, I just assume they would just assume
> >> they can't use units on it because the default value in the file
> >> doesn't have units.
> >
> > But the default value *does* have units.
> >
> It does? Didn't in my file. I must've overwritten it with a config file
> from some earlier beta (or snapshot) that didn't have it or so - my
> default value certainly didn't have it ;-)

Just to confirm, yes the sample I submitted a patch for does have units.

Joshua D. Drake

>
> //Magnus
>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:51:57
Message-ID: 200612192351.59402.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Joshua D. Drake wrote:
> I am not suggestion variant capitalization. I am suggestion a simple
> document patch to help eliminate what may not be obvious.

Perhaps it would be more effective to clarify the error message? Right
now it just says something to the effect of "invalid integer". I'd
imagine "invalid memory unit: TB" would be less confusing.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Kenneth Marshall" <ktm(at)it(dot)is(dot)rice(dot)edu>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 22:57:19
Message-ID: 874prrjxyo.fsf@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


"Kenneth Marshall" <ktm(at)it(dot)is(dot)rice(dot)edu> writes:

> My one comment is that a little 'b' is used to indicate bits normally
> and a capital 'B' is used to indicate bytes. So
> kb = '1024 bits'
> kB = '1024 bytes'
> I do think that whether or not the k/m/g is upper case or lower case
> is immaterial.

Yes, well, no actually there are standard capitalizations for the k and M and
G. A lowercase g is a gram and a lowercase m means "milli-".

But I think that only gets you as far as concluding that Postgres ought to
consistently use kB MB and GB in its own output. Which afaik it does.

To reach a conclusion about whether it should restrict valid user input
similarly you would have to make some sort of argument about what problems it
could lead to if we allow users to be sloppy.

I could see such an argument being made but it requires a lot of speculation
about hypothetical future parameters and future problems. When we have known
real problems today.

And yes, btw, the case sensitivity of these units had already surprised and
bothered me earlier and I failed to mention it at the time.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Kenneth Marshall <ktm(at)is(dot)rice(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-19 23:52:31
Message-ID: 200612192352.kBJNqVO14152@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Gregory Stark wrote:
>
> "Kenneth Marshall" <ktm(at)it(dot)is(dot)rice(dot)edu> writes:
>
> > My one comment is that a little 'b' is used to indicate bits normally
> > and a capital 'B' is used to indicate bytes. So
> > kb = '1024 bits'
> > kB = '1024 bytes'
> > I do think that whether or not the k/m/g is upper case or lower case
> > is immaterial.
>
> Yes, well, no actually there are standard capitalizations for the k and M and
> G. A lowercase g is a gram and a lowercase m means "milli-".

I will have 150 grams of shared memory, please.

> But I think that only gets you as far as concluding that Postgres ought to
> consistently use kB MB and GB in its own output. Which afaik it does.
>
> To reach a conclusion about whether it should restrict valid user input
> similarly you would have to make some sort of argument about what problems it
> could lead to if we allow users to be sloppy.
>
> I could see such an argument being made but it requires a lot of speculation
> about hypothetical future parameters and future problems. When we have known
> real problems today.
>
> And yes, btw, the case sensitivity of these units had already surprised and
> bothered me earlier and I failed to mention it at the time.

Agreed. However, I see 'ms' as milliseconds, so perhaps the M vs. m is
already in use. I think we at least need to document the case
sensitivity and improve the error message.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 00:16:14
Message-ID: 14040.1166573774@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Perhaps it would be more effective to clarify the error message? Right
> now it just says something to the effect of "invalid integer". I'd
> imagine "invalid memory unit: TB" would be less confusing.

+1 on that, but I think we should just accept the strings
case-insensitively, too. SQL in general is not case sensitive for
keywords, and neither is anything else in the postgresql.conf file,
so I argue it's inconsistent to be strict about the case for units.

Nor do I believe that we'd ever accept a future patch that made
the distinction between "kb" and "kB" significant --- if you think
people are confused now, just imagine what would happen then.

regards, tom lane


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 01:04:29
Message-ID: 1166576669.22487.173.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 2006-12-19 at 19:16 -0500, Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Perhaps it would be more effective to clarify the error message? Right
> > now it just says something to the effect of "invalid integer". I'd
> > imagine "invalid memory unit: TB" would be less confusing.
>
> +1 on that, but I think we should just accept the strings
> case-insensitively, too. SQL in general is not case sensitive for
> keywords, and neither is anything else in the postgresql.conf file,
> so I argue it's inconsistent to be strict about the case for units.

Hello,

Attached is a simple patch that replaces strcmp() with pg_strcasecmp().
Thanks to AndrewS for pointing out that I shouldn't use strcasecp().

I compiled and installed, ran an initdb with 32mb (versus 32MB) and it
seems to work correctly with a show shared_buffers;

Sincerely,

Joshua D. Drake

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

Attachment Content-Type Size
guc.patch text/x-patch 2.1 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 01:18:50
Message-ID: 200612200218.52165.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Nor do I believe that we'd ever accept a future patch that made
> the distinction between "kb" and "kB" significant --- if you think
> people are confused now, just imagine what would happen then.

As I said elsewhere, I'd imagine future functionality like a units-aware
data type, which has been talked about several times, and then this
would be really bad.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 01:19:57
Message-ID: 200612200219.58195.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Joshua D. Drake wrote:
> I compiled and installed, ran an initdb with 32mb (versus 32MB) and
> it seems to work correctly with a show shared_buffers;

Did it actually allocate 32 millibits of shared buffers?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 01:33:41
Message-ID: 200612200233.42610.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> +1 on that, but I think we should just accept the strings
> case-insensitively, too.

I think if we'd allow this to spread, documentation, example files and
other material would use it inconsistently, and even more people would
be confused and it would make us look silly.

It's not like anyone has pointed out a real use case here. The default
file has the units already, so it's not like they're hard to guess.
And Magnus's issue was that the error message was confusing. So let's
fix that.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 01:44:26
Message-ID: 1166579066.22487.176.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, 2006-12-20 at 02:19 +0100, Peter Eisentraut wrote:
> Joshua D. Drake wrote:
> > I compiled and installed, ran an initdb with 32mb (versus 32MB) and
> > it seems to work correctly with a show shared_buffers;
>
> Did it actually allocate 32 millibits of shared buffers?

Funny :)

Joshua D. Drake

>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 02:45:52
Message-ID: 1166582752.22487.183.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> Hello,
>
> Attached is a simple patch that replaces strcmp() with pg_strcasecmp().
> Thanks to AndrewS for pointing out that I shouldn't use strcasecp().
>

That should be AndrewD :)

J

> I compiled and installed, ran an initdb with 32mb (versus 32MB) and it
> seems to work correctly with a show shared_buffers;
>
> Sincerely,
>
> Joshua D. Drake
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 03:15:29
Message-ID: 16054.1166584529@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane wrote:
>> Nor do I believe that we'd ever accept a future patch that made
>> the distinction between "kb" and "kB" significant --- if you think
>> people are confused now, just imagine what would happen then.

> As I said elsewhere, I'd imagine future functionality like a units-aware
> data type, which has been talked about several times, and then this
> would be really bad.

Only if the units-aware datatype insisted on case-sensitive units, which
is at variance with the SQL spec's treatment of keywords, the existing
practice in postgresql.conf, the existing practice in our datatypes such
as timestamp and interval:

regression=# select '20-dec-2006'::timestamp;
timestamp
---------------------
2006-12-20 00:00:00
(1 row)

regression=# select '20-DEC-2006'::timestamp;
timestamp
---------------------
2006-12-20 00:00:00
(1 row)

regression=# select '20-Dec-2006 America/New_York'::timestamptz;
timestamptz
------------------------
2006-12-20 00:00:00-05
(1 row)

regression=# select '20-Dec-2006 AMERICA/NEW_york'::timestamptz;
timestamptz
------------------------
2006-12-20 00:00:00-05
(1 row)

regression=# select '20-Dec-2006 PST'::timestamptz;
timestamptz
------------------------
2006-12-20 03:00:00-05
(1 row)

regression=# select '20-Dec-2006 pst'::timestamptz;
timestamptz
------------------------
2006-12-20 03:00:00-05
(1 row)

regression=# select '1 day'::interval;
interval
----------
1 day
(1 row)

regression=# select '1 DAY'::interval;
interval
----------
1 day
(1 row)

and in general, there is simply not any other part of Postgres or SQL
that you can point to that supports the idea that case sensitivity
for keywords is expected behavior. So I think we'd flat-out reject
any such datatype.

(Hmm, I wonder what Tom Dunstan's enum patch does about case
sensitivity...)

regards, tom lane


From: Shane Ambler <pgsql(at)007Marketing(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 04:34:55
Message-ID: 4588BD6F.8030706@007Marketing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Tom Lane wrote:
>> Nor do I believe that we'd ever accept a future patch that made
>> the distinction between "kb" and "kB" significant --- if you think
>> people are confused now, just imagine what would happen then.
>
> As I said elsewhere, I'd imagine future functionality like a units-aware
> data type, which has been talked about several times, and then this
> would be really bad.
>

Most if not all of us here with computer knowledge (particularly at the
programming level) know the difference between capital and lowercase
memory/data size abbreviations.

Case insensitive size measurements don't matter if you actually know
what the abbreviations mean.

The case where case matters ;-) is b and B (bits and Bytes for those
that don't know the diff)

And if you don't know the difference between m and M - one is a portion
of and the other is a multiple of. So mB would technically mean 0.001 of
a byte. I'd like to see you allocate that!!

As is the case of many english words - the context of the usage makes a
big difference in the interpretation.

Given that the purpose of the effective_cache_size setting (and similar)
is to specify the amount of memory you want allocated/limited to, then
that context allows you to assume that all unit abbreviations are
specifying bytes/kilobytes/megabytes/gigabytes and not
bits/kilobits/millibits/millibytes etc

As for the future - well, TB is getting more common, petabytes of
storage has been talked about, 64bit systems can access exabytes of ram.
Next would be zettabytes and yottabytes.

Unless we start a roman numeral system for amounts bigger than that then
I seriously doubt that we will hit any confusion with future usage. (and
I doubt in our lifetimes) Though I suppose with storage expansion rates
increasing the way they have the last few years we may be using
yottabyte hard drives on our 256bit systems with 512 zettabytes of ram
in about 15 years ;-)

That might make it around the end of life for the 8.0 branch so maybe we
need to consider handling these future storage needs soon?

Maybe in 40 years we will all retire with mega-yotta-byte drives in our
pda watches?

As for units aware datatypes - what options are available will need to
be decided at implementation time. Will we allow megabit (Mb) size
allocations or only megabyte? I would say bits would be clearly
specified as such (bit instead of b)

Let's skip any flame wars on this and concentrate on the humorous future
storage sizes.

--

Shane Ambler
pgSQL(at)007Marketing(dot)com

Get Sheeky @ http://Sheeky.Biz


From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "Magnus Hagander" <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 05:50:40
Message-ID: 36e682920612192150v553e7644q9dac787b8bc6bab7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 12/19/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I think we should just accept the strings case-insensitively, too.

While acknowledging Peter's pedantically-correct points, I say +1 for
ease of use.

--
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 3rd Floor | jharris(at)enterprisedb(dot)com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/


From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 06:06:21
Message-ID: D1B9B499-6C56-4D0D-B8F3-C82F22F43542@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Dec 19, 2006, at 9:50 PM, Jonah H. Harris wrote:

> On 12/19/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I think we should just accept the strings case-insensitively, too.
>
> While acknowledging Peter's pedantically-correct points, I say +1 for
> ease of use.

+1. I spend some time walking people through tuning issues
by phone or IM. Anything that complicates supporting users or
frustrates users for no actual benefit is a bad thing.

(And this is unrelated to any theoretical units-aware data type -
we might well be interested in milliwatts and megawatts in a
datatype, but in the configuration file we're unlikely to ever
need to configure things in units of millibits).

Cheers,
Steve


From: Tom Dunstan <pgsql(at)tomd(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 12:42:09
Message-ID: 45892FA1.6060808@tomd.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:

> (Hmm, I wonder what Tom Dunstan's enum patch does about case
> sensitivity...)

Currently enum labels are case sensitive. I was a bit ambivalent about
it... case insensitivity can lead to less surprises in some cases, but
many programming languages that have enums are case sensitive, and so
this wouldn't be a direct map for them. OTOH, if someone's doing evil
things like sticking labels that differ only in case into an enum,
perhaps they *should* be dissuaded. :)

The question is where does it end, though? Should we treat letters with
accents and umlauts as equivalent as well? Do we remove punctuation
characters? It gets into a (for me) more murky localization issue, and
I'm not familiar with the postgresql apis for handling that. Maybe it's
easy.

Since we basically accept any old thing into an enum label, I think we
probably shouldn't muck with it. If we want to have some sort of
normalized version, then we should probably restrict the characters that
we accept fairly severely.

Also note that enum values are far more likely to be set by application
code than by a human typing the value in directly, so in that sense the
need for case insensitivity seems somewhat diminished.

I suppose we should think about mysql refugees at some point, though. I
wonder what they do. The documentation is silent on the matter (and all
their examples are in lower case). Mysql is generally case insensitive,
right?

Cheers

Tom


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Dunstan <pgsql(at)tomd(dot)cc>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 16:07:34
Message-ID: 200612201707.36661.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Am Mittwoch, 20. Dezember 2006 13:42 schrieb Tom Dunstan:
> I suppose we should think about mysql refugees at some point, though. I
> wonder what they do. The documentation is silent on the matter (and all
> their examples are in lower case). Mysql is generally case insensitive,
> right?

Maybe you can make sense of this, but I can't ...

mysql> create table test (a int, b enum ('x', 'X', 'y'));
Query OK, 0 rows affected, 1 warning (0.02 sec)

mysql> show warnings;
+-------+------+---------------------------------------------+
| Level | Code | Message |
+-------+------+---------------------------------------------+
| Note | 1291 | Column 'b' has duplicated value 'x' in ENUM |
+-------+------+---------------------------------------------+
1 row in set (0.00 sec)

mysql> insert into test values (1, 'x');
Query OK, 1 row affected (0.00 sec)

mysql> insert into test values (1, 'X');
Query OK, 1 row affected (0.00 sec)

mysql> insert into test values (1, 'y');
Query OK, 1 row affected (0.00 sec)

mysql> insert into test values (1, 'Y');
Query OK, 1 row affected (0.00 sec)

mysql> insert into test values (1, 'z');
Query OK, 1 row affected, 1 warning (0.00 sec)

## You think that was funny -- now watch this:

mysql> select * from test;
+------+------+
| a | b |
+------+------+
| 1 | x |
| 1 | x |
| 1 | y |
| 1 | y |
| 1 | |
+------+------+
5 rows in set (0.00 sec)

mysql> drop table test;
Query OK, 0 rows affected (0.00 sec)

mysql> create table test (a int, b enum ('ä', 'Ä', ' ', ' '));
## Above is a-diaeresis, A-diaeresis.
Query OK, 0 rows affected, 2 warnings (0.00 sec)

mysql> show warnings;
+-------+------+---------------------------------------------+
| Level | Code | Message |
+-------+------+---------------------------------------------+
| Note | 1291 | Column 'b' has duplicated value '?' in ENUM | # literal ?
| Note | 1291 | Column 'b' has duplicated value '' in ENUM |
+-------+------+---------------------------------------------+
2 rows in set (0.00 sec)

mysql> insert into test values (1, ' ');
Query OK, 1 row affected (0.00 sec)

mysql> insert into test values (1, ' ');
Query OK, 1 row affected (0.00 sec)

mysql> insert into test values (1, ' ');
Query OK, 1 row affected (0.01 sec)

mysql> insert into test values (1, ' |');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1265 | Data truncated for column 'b' at row 1 |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)

mysql> select distinct * from test;
+------+------+
| a | b |
+------+------+
| 1 | ä |
| 1 | |
| 1 | |
+------+------+

Better not imitate that.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Dunstan <pgsql(at)tomd(dot)cc>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-20 16:26:19
Message-ID: 4589642B.4050200@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Am Mittwoch, 20. Dezember 2006 13:42 schrieb Tom Dunstan:
>
>> I suppose we should think about mysql refugees at some point, though. I
>> wonder what they do. The documentation is silent on the matter (and all
>> their examples are in lower case). Mysql is generally case insensitive,
>> right?
>>
>
> Maybe you can make sense of this, but I can't ...
>
>
>
[lots of amusing non-orthogonal braindead stuff ...]
>
> Better not imitate that.
>
>

The MySQL treatment of enums is generally quite reprehensible. The
proposed patch by contrast fits quite well into our existing type
system, I think. MySQL users migrating will have a bit of work to do.

I don't think their experience has much to teach us (except how not to
do enums). We should decide on case sensitivity without having reference
to it.

cheers

andrew


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Steve Atkins <steve(at)blighty(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-27 00:50:31
Message-ID: 1167180631.3678.26.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 2006-12-19 at 22:06 -0800, Steve Atkins wrote:
> On Dec 19, 2006, at 9:50 PM, Jonah H. Harris wrote:
>
> > On 12/19/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> I think we should just accept the strings case-insensitively, too.
> >
> > While acknowledging Peter's pedantically-correct points, I say +1 for
> > ease of use.
>
> +1. I spend some time walking people through tuning issues
> by phone or IM. Anything that complicates supporting users or
> frustrates users for no actual benefit is a bad thing.
>
> (And this is unrelated to any theoretical units-aware data type -
> we might well be interested in milliwatts and megawatts in a
> datatype, but in the configuration file we're unlikely to ever
> need to configure things in units of millibits).

Where we at on this?

Joshua D. Drake

>
> Cheers,
> Steve
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Steve Atkins <steve(at)blighty(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-27 05:07:51
Message-ID: 11830.1167196071@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
> On 12/19/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I think we should just accept the strings case-insensitively, too.

> Where we at on this?

Anyone against making it case-insensitive, speak now or hold your peace.

regards, tom lane


From: Benny Amorsen <benny+usenet(at)amorsen(dot)dk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-27 08:39:22
Message-ID: m3hcvhbumd.fsf@ursa.amorsen.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>>>>> "TL" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

TL> Anyone against making it case-insensitive, speak now or hold your
TL> peace.

SI-units are inherently case-sensitive. The obvious example is that
now you will allow people to specify an amount in millibytes, while
interpreting it in megabytes.

You are trying to interpret valid input as misspellings based on
context, and then you silently guess at what the user really meant.
That's MySQL behaviour!

/Benny


From: tomas(at)tuxteam(dot)de
To: Benny Amorsen <benny+usenet(at)amorsen(dot)dk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-27 09:45:58
Message-ID: 20061227094558.GC15370@www.trapp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Dec 27, 2006 at 09:39:22AM +0100, Benny Amorsen wrote:
> >>>>> "TL" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> TL> Anyone against making it case-insensitive, speak now or hold your
> TL> peace.
>
> SI-units are inherently case-sensitive [...]

As a notorious lurker, set my weight to one mg (choose the case ;-)

I'd tend to keep case sensitivity, but will hold my peace regardless of
outcome.

Thanks
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFkkDWBcgs9XrR2kYRAmKFAJwPMOwl+IbCbMQvszn9RKpXRW3N6ACfbwne
juGsqnMsj2BMyCO+BjP9hq4=
=KCiY
-----END PGP SIGNATURE-----


From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Benny Amorsen <benny+usenet(at)amorsen(dot)dk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-28 12:25:10
Message-ID: 20061228122510.GR71246@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Dec 27, 2006 at 09:39:22AM +0100, Benny Amorsen wrote:
> >>>>> "TL" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> TL> Anyone against making it case-insensitive, speak now or hold your
> TL> peace.
>
> SI-units are inherently case-sensitive. The obvious example is that
> now you will allow people to specify an amount in millibytes, while
> interpreting it in megabytes.

Yes, and I can't think of a single reason why we'd let people specify
anything in millibytes, or kilobits. Truth is, I bet many (if not most)
DBAs barely know that case matters in the units. And even those that do
are likely to prefer ease of use to pedantics.

As for the comments about SI datatypes and MySQL-isms, there's a hell of
a big difference between muddying the line in a config file for ease of
use and stomping on data that's actually stored in the database.
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


From: Benny Amorsen <benny+usenet(at)amorsen(dot)dk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-29 10:42:15
Message-ID: m3d563asqg.fsf@ursa.amorsen.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>>>>> "JCN" == Jim C Nasby <jim(at)nasby(dot)net> writes:

JCN> Truth is, I bet many (if not most) DBAs barely know that case
JCN> matters in the units.

Sounds like the school system needs fixing, then.

/Benny


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Benny Amorsen <benny+usenet(at)amorsen(dot)dk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-29 22:03:05
Message-ID: 20061229220305.GA15429@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Benny Amorsen wrote:
> >>>>> "JCN" == Jim C Nasby <jim(at)nasby(dot)net> writes:
>
> JCN> Truth is, I bet many (if not most) DBAs barely know that case
> JCN> matters in the units.
>
> Sounds like the school system needs fixing, then.

Sure, but it probably shows a lot more prominently in other areas than
in unit casing though.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: "Andrew Hammond" <andrew(dot)george(dot)hammond(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-30 23:36:24
Message-ID: 1167521784.582986.264710@h40g2000cwb.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Benny Amorsen wrote:
> >>>>> "TL" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> TL> Anyone against making it case-insensitive, speak now or hold your
> TL> peace.
>
> SI-units are inherently case-sensitive. The obvious example is that
> now you will allow people to specify an amount in millibytes, while
> interpreting it in megabytes.

And as Peter points out, there may be a desire to support SI-type units
in other parts of the database at some time in the future. It seems
like a questionable idea to break with convention just for ease of use.

> You are trying to interpret valid input as misspellings based on
> context, and then you silently guess at what the user really meant.
> That's MySQL behaviour!

I agree. But perhaps the solution instead of failing is to throw a
warning to the effect of "Not to be pedantic, but you said mb and
millibits as a unit doesn't make sense in this context. Assuming you
meant MB (MegaBits)." and then start up.

Generally I'm against guessing what the user really wants, but in this
case, it seems pretty difficult to guess wrong. But either way I'm
always dead set against _silently_ guessing.

Andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrew Hammond" <andrew(dot)george(dot)hammond(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2006-12-31 01:16:45
Message-ID: 25736.1167527805@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Andrew Hammond" <andrew(dot)george(dot)hammond(at)gmail(dot)com> writes:
> I agree. But perhaps the solution instead of failing is to throw a
> warning to the effect of "Not to be pedantic, but you said mb and
> millibits as a unit doesn't make sense in this context. Assuming you
> meant MB (MegaBits)." and then start up.
> Generally I'm against guessing what the user really wants, but in this
> case, it seems pretty difficult to guess wrong. But either way I'm
> always dead set against _silently_ guessing.

Bear in mind that the typical place for this sort of thing is
postgresql.conf, and for problems in that file the only place we can
emit a warning is into the postmaster log, which far too many users
never look at (if indeed it's going anywhere but /dev/null in the first
place). So I can't get very excited about "report a warning" as a
compromise solution.

Personally I don't find the argument about "someday we might want to
support measurements in millibits" to be convincing at all, and
certainly it seems weaker than the argument that "units should be case
insensitive because everything else in this file is". The SQL spec
has to be considered a more relevant controlling precedent for us than
the SI units spec, and there are no case-sensitive keywords in SQL.

regards, tom lane


From: Benny Amorsen <benny+usenet(at)amorsen(dot)dk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2007-01-01 19:10:46
Message-ID: m33b6ubm15.fsf@ursa.amorsen.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>>>>> "TL" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

TL> Personally I don't find the argument about "someday we might want
TL> to support measurements in millibits" to be convincing at all, and
TL> certainly it seems weaker than the argument that "units should be
TL> case insensitive because everything else in this file is". The SQL
TL> spec has to be considered a more relevant controlling precedent
TL> for us than the SI units spec, and there are no case-sensitive
TL> keywords in SQL.

Units simply are not case sensitive. They are just a more or less
random collection of preexisting symbols, because that was easier than
drawing up entirely new ones. Not all are English letters, for one µ
is not. If you upper case a text with units in, the units do not
change with the rest of the text.

/Benny


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Benny Amorsen <benny+usenet(at)amorsen(dot)dk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2007-01-01 19:23:10
Message-ID: 19636.1167679390@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Benny Amorsen <benny+usenet(at)amorsen(dot)dk> writes:
> "TL" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> TL> Personally I don't find the argument about "someday we might want
> TL> to support measurements in millibits" to be convincing at all, and
> TL> certainly it seems weaker than the argument that "units should be
> TL> case insensitive because everything else in this file is". The SQL
> TL> spec has to be considered a more relevant controlling precedent
> TL> for us than the SI units spec, and there are no case-sensitive
> TL> keywords in SQL.

> Units simply are not case sensitive. They are just a more or less
> random collection of preexisting symbols, because that was easier than
> drawing up entirely new ones. Not all are English letters, for one
> is not.

You mean "are case sensitive" right? This is not news. The point I'm
basically making is that it's not going to hurt us to restrict GUC to
supporting a subset of all-possible-units that can be treated
case-insensitively. We're already going to restrict the allowed
character set: I can guarantee you that , or anything else
outside 7-bit ASCII, will never be accepted. It's just not worth the
trouble of dealing with multiple possible encodings.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Benny Amorsen <benny+usenet(at)amorsen(dot)dk>
Subject: Re: effective_cache_size vs units
Date: 2007-01-02 10:48:25
Message-ID: 200701021148.27707.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Am Donnerstag, 28. Dezember 2006 13:25 schrieb Jim C. Nasby:
> Yes, and I can't think of a single reason why we'd let people specify
> anything in millibytes, or kilobits.

How about a configuration option related to connection throughput, which is
typically measured in bits?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Benny Amorsen <benny+usenet(at)amorsen(dot)dk>
Subject: Re: effective_cache_size vs units
Date: 2007-01-02 15:19:38
Message-ID: 3591.1167751178@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Am Donnerstag, 28. Dezember 2006 13:25 schrieb Jim C. Nasby:
>> Yes, and I can't think of a single reason why we'd let people specify
>> anything in millibytes, or kilobits.

> How about a configuration option related to connection throughput, which is
> typically measured in bits?

But at least as often in bytes. What's more, if the system really were
to accept both units, you could reasonably expect that people would get
it wrong at least half the time ...

regards, tom lane


From: "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Cc: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, "Benny Amorsen" <benny+usenet(at)amorsen(dot)dk>
Subject: Re: effective_cache_size vs units
Date: 2007-01-03 11:56:11
Message-ID: E1539E0ED7043848906A8FF995BDA57901A355BF@m0143.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> > Yes, and I can't think of a single reason why we'd let people
specify
> > anything in millibytes, or kilobits.
>
> How about a configuration option related to connection throughput,
which is
> typically measured in bits?

We'd use "kbit". I don't see us using "kb" in that case (or was it kB
:-).

Andreas


From: Jim Nasby <decibel(at)decibel(dot)org>
To: Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: effective_cache_size vs units
Date: 2007-01-03 15:33:35
Message-ID: 20A73B60-41F0-4FAB-BF91-252F688E6449@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

You just proved the case for why the units shouldn't be case sensitive:

On Dec 30, 2006, at 6:36 PM, Andrew Hammond wrote:
> I agree. But perhaps the solution instead of failing is to throw a
> warning to the effect of "Not to be pedantic, but you said mb and
> millibits as a unit doesn't make sense in this context. Assuming you
> meant MB (MegaBits)." and then start up.

Do we really want people specifying effective_cache_size in *bits*,
mega or not? I think no.

To reply to Peter's comment, yes, bits would be useful if we ever
actually have any settings relating to network bandwidth. But that's
a really big IF. IF we do eventually decide to add such a setting, I
think it would make the most sense to spell out 'bits' in the unit.
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)