effective_cache_size vs units
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
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/
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
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
Magnus Hagander <magnus@hagander.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
On Mon, 2006-12-18 at 23:46 -0500, Tom Lane wrote:
Magnus Hagander <magnus@hagander.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
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@hagander.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
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/
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
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
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
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@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
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
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/
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
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
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/
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
"Tom Lane" <tgl@sss.pgh.pa.us> writes:
Magnus Hagander <magnus@hagander.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
On Tue, Dec 19, 2006 at 10:12:34PM +0000, Gregory Stark wrote:
"Tom Lane" <tgl@sss.pgh.pa.us> writes:
Magnus Hagander <magnus@hagander.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
Show quoted text
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?