Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
bab54e38
Commit
bab54e38
authored
Jun 20, 2013
by
Fujii Masao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support TB (terabyte) memory unit in GUC variables.
Patch by Simon Riggs, reviewed by Jeff Janes and me.
parent
f979599b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
doc/src/sgml/config.sgml
doc/src/sgml/config.sgml
+1
-1
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+24
-2
src/backend/utils/misc/postgresql.conf.sample
src/backend/utils/misc/postgresql.conf.sample
+1
-1
No files found.
doc/src/sgml/config.sgml
View file @
bab54e38
...
...
@@ -39,7 +39,7 @@
For convenience,
a different unit can also be specified explicitly. Valid memory units
are <literal>kB</literal> (kilobytes), <literal>MB</literal>
(megabytes),
and <literal>GB</literal> (gig
abytes); valid time units
(megabytes),
<literal>GB</literal> (gigabytes), and <literal>TB</literal> (ter
abytes); 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
...
...
src/backend/utils/misc/guc.c
View file @
bab54e38
...
...
@@ -105,6 +105,7 @@
#define KB_PER_MB (1024)
#define KB_PER_GB (1024*1024)
#define KB_PER_TB (1024*1024*1024)
#define MS_PER_S 1000
#define S_PER_MIN 60
...
...
@@ -4837,7 +4838,7 @@ parse_int(const char *value, int *result, int flags, const char **hintmsg)
{
/* Set hint for use if no match or trailing garbage */
if
(
hintmsg
)
*
hintmsg
=
gettext_noop
(
"Valid units for this parameter are
\"
kB
\"
,
\"
MB
\"
,
and
\"
G
B
\"
."
);
*
hintmsg
=
gettext_noop
(
"Valid units for this parameter are
\"
kB
\"
,
\"
MB
\"
,
\"
GB
\"
, and
\"
T
B
\"
."
);
#if BLCKSZ < 1024 || BLCKSZ > (1024*1024)
#error BLCKSZ must be between 1KB and 1MB
...
...
@@ -4891,6 +4892,22 @@ parse_int(const char *value, int *result, int flags, const char **hintmsg)
break
;
}
}
else
if
(
strncmp
(
endptr
,
"TB"
,
2
)
==
0
)
{
endptr
+=
2
;
switch
(
flags
&
GUC_UNIT_MEMORY
)
{
case
GUC_UNIT_KB
:
val
*=
KB_PER_TB
;
break
;
case
GUC_UNIT_BLOCKS
:
val
*=
KB_PER_TB
/
(
BLCKSZ
/
1024
);
break
;
case
GUC_UNIT_XBLOCKS
:
val
*=
KB_PER_TB
/
(
XLOG_BLCKSZ
/
1024
);
break
;
}
}
}
else
if
(
flags
&
GUC_UNIT_TIME
)
{
...
...
@@ -7384,7 +7401,12 @@ _ShowOption(struct config_generic * record, bool use_units)
break
;
}
if
(
result
%
KB_PER_GB
==
0
)
if
(
result
%
KB_PER_TB
==
0
)
{
result
/=
KB_PER_TB
;
unit
=
"TB"
;
}
else
if
(
result
%
KB_PER_GB
==
0
)
{
result
/=
KB_PER_GB
;
unit
=
"GB"
;
...
...
src/backend/utils/misc/postgresql.conf.sample
View file @
bab54e38
...
...
@@ -27,7 +27,7 @@
# Memory units: kB = kilobytes Time units: ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
#
h = hours
#
TB = terabytes
h = hours
# d = days
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment