Skip to content

Commit b517e65

Browse files
committed
Allow units to be specified with configuration settings.
1 parent a998a69 commit b517e65

File tree

8 files changed

+289
-73
lines changed

8 files changed

+289
-73
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.127 2006/07/25 03:51:21 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.128 2006/07/27 08:30:41 petere Exp $ -->
22
<!--
33
Documentation of the system catalogs, directed toward PostgreSQL developers
44
-->
@@ -5482,6 +5482,12 @@
54825482
<entry></entry>
54835483
<entry>current value of the parameter</entry>
54845484
</row>
5485+
<row>
5486+
<entry><structfield>unit</structfield></entry>
5487+
<entry><type>text</type></entry>
5488+
<entry></entry>
5489+
<entry>implicit unit of the parameter</entry>
5490+
</row>
54855491
<row>
54865492
<entry><structfield>category</structfield></entry>
54875493
<entry><type>text</type></entry>

doc/src/sgml/config.sgml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.70 2006/07/26 11:35:55 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.71 2006/07/27 08:30:41 petere Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -28,6 +28,20 @@
2828
(all case-insensitive) or any unambiguous prefix of these.
2929
</para>
3030

31+
<para>
32+
Some settings specify a memory or time value. Each of these has
33+
an implicit unit, which is either kilobytes, blocks (typically 8
34+
kilobytes), milliseconds, seconds, or minutes. For convenience, a
35+
(possibly different) unit can also be specified explicitly. Valid
36+
memory units are <literal>kB</literal> (kilobytes),
37+
<literal>MB</literal> (megabytes), and <literal>GB</literal>
38+
(gigabytes); valid time units are <literal>ms</literal>
39+
(milliseconds), <literal>s</literal> (seconds),
40+
<literal>min</literal> (minutes), <literal>h</literal> (hours),
41+
and <literal>d</literal> (days). Note that the multiplier for
42+
memory units in 1024, not 1000.
43+
</para>
44+
3145
<para>
3246
One way to set these parameters is to edit the file
3347
<filename>postgresql.conf</><indexterm><primary>postgresql.conf</></>,
@@ -39,6 +53,7 @@
3953
log_connections = yes
4054
log_destination = 'syslog'
4155
search_path = '"$user", public'
56+
shared_buffers = 128MB
4257
</programlisting>
4358
One parameter is specified per line. The equal sign between name and
4459
value is optional. Whitespace is insignificant and blank lines are

src/backend/catalog/system_views.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 1996-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.28 2006/07/25 03:51:21 tgl Exp $
6+
* $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.29 2006/07/27 08:30:41 petere Exp $
77
*/
88

99
CREATE VIEW pg_roles AS
@@ -172,7 +172,7 @@ CREATE VIEW pg_prepared_statements AS
172172
CREATE VIEW pg_settings AS
173173
SELECT *
174174
FROM pg_show_all_settings() AS A
175-
(name text, setting text, category text, short_desc text, extra_desc text,
175+
(name text, setting text, unit text, category text, short_desc text, extra_desc text,
176176
context text, vartype text, source text, min_val text, max_val text);
177177

178178
CREATE RULE pg_settings_u AS

src/backend/utils/misc/guc-file.l

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.37 2006/03/07 01:03:12 tgl Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.38 2006/07/27 08:30:41 petere Exp $
88
*/
99

1010
%{
@@ -68,7 +68,9 @@ SIGN ("-"|"+")
6868
DIGIT [0-9]
6969
HEXDIGIT [0-9a-fA-F]
7070

71-
INTEGER {SIGN}?({DIGIT}+|0x{HEXDIGIT}+)
71+
UNIT_LETTER [a-zA-Z]
72+
73+
INTEGER {SIGN}?({DIGIT}+|0x{HEXDIGIT}+){UNIT_LETTER}*
7274

7375
EXPONENT [Ee]{SIGN}?{DIGIT}+
7476
REAL {SIGN}?{DIGIT}*"."{DIGIT}*{EXPONENT}?

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy