Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6e7baa3

Browse files
committed
Introduce BYTES unit for GUCs.
This is already useful for track_activity_query_size, and will furtherbe used in a later commit making the WAL segment size configurable.Author: Beena EmersonReviewed-By: Andres FreundDiscussion:https://postgr.es/m/CAOG9ApEu8bXVwBxkOO9J7ZpM76TASK_vFMEEiCEjwhMmSLiaqQ@mail.gmail.com
1 parent2d4a614 commit6e7baa3

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

‎src/backend/utils/misc/guc.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,11 @@ static const char *memory_units_hint = gettext_noop("Valid units for this parame
722722

723723
staticconstunit_conversionmemory_unit_conversion_table[]=
724724
{
725+
{"GB",GUC_UNIT_BYTE,1024*1024*1024},
726+
{"MB",GUC_UNIT_BYTE,1024*1024},
727+
{"kB",GUC_UNIT_BYTE,1024},
728+
{"B",GUC_UNIT_BYTE,1},
729+
725730
{"TB",GUC_UNIT_KB,1024*1024*1024},
726731
{"GB",GUC_UNIT_KB,1024*1024},
727732
{"MB",GUC_UNIT_KB,1024},
@@ -2863,11 +2868,7 @@ static struct config_int ConfigureNamesInt[] =
28632868
{"track_activity_query_size",PGC_POSTMASTER,RESOURCES_MEM,
28642869
gettext_noop("Sets the size reserved for pg_stat_activity.query, in bytes."),
28652870
NULL,
2866-
2867-
/*
2868-
* There is no _bytes_ unit, so the user can't supply units for
2869-
* this.
2870-
*/
2871+
GUC_UNIT_BYTE
28712872
},
28722873
&pgstat_track_activity_query_size,
28732874
1024,100,102400,
@@ -8113,6 +8114,9 @@ GetConfigOptionByNum(int varnum, const char **values, bool *noshow)
81138114
{
81148115
switch (conf->flags& (GUC_UNIT_MEMORY |GUC_UNIT_TIME))
81158116
{
8117+
caseGUC_UNIT_BYTE:
8118+
values[2]="B";
8119+
break;
81168120
caseGUC_UNIT_KB:
81178121
values[2]="kB";
81188122
break;

‎src/include/utils/guc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ typedef enum
219219
#defineGUC_UNIT_BLOCKS0x2000/* value is in blocks */
220220
#defineGUC_UNIT_XBLOCKS0x3000/* value is in xlog blocks */
221221
#defineGUC_UNIT_MB0x4000/* value is in megabytes */
222+
#defineGUC_UNIT_BYTE0x8000/* value is in bytes */
222223
#defineGUC_UNIT_MEMORY0xF000/* mask for size-related units */
223224

224225
#defineGUC_UNIT_MS 0x10000/* value is in milliseconds */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp