Skip to content

Commit f7bda63

Browse files
committed
Improve defaults shown in postgresql.conf.sample and pg_settings
Previously, these showed unlikely default values. The new default value 128MB (since PG 10) is not always accurate since initdb tries several increasing values, but it likely to be accurate. Reported-by: Zhangjie <zhangjie2@fujitsu.com> Discussion: https://postgr.es/m/TYWPR01MB7678772FD8640C404F1DC882F9079@TYWPR01MB7678.jpnprd01.prod.outlook.com Author: Zhangjie Backpatch-through: master
1 parent a3fcbcd commit f7bda63

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/backend/utils/misc/guc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2333,7 +2333,7 @@ static struct config_int ConfigureNamesInt[] =
23332333
GUC_UNIT_BLOCKS
23342334
},
23352335
&NBuffers,
2336-
1024, 16, INT_MAX / 2,
2336+
16384, 16, INT_MAX / 2,
23372337
NULL, NULL, NULL
23382338
},
23392339

src/backend/utils/misc/postgresql.conf.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124

125125
# - Memory -
126126

127-
#shared_buffers = 32MB # min 128kB
127+
#shared_buffers = 128MB # min 128kB
128128
# (change requires restart)
129129
#huge_pages = try # on, off, or try
130130
# (change requires restart)

src/bin/initdb/initdb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ setup_config(void)
10711071
else
10721072
snprintf(repltok, sizeof(repltok), "shared_buffers = %dkB",
10731073
n_buffers * (BLCKSZ / 1024));
1074-
conflines = replace_token(conflines, "#shared_buffers = 32MB", repltok);
1074+
conflines = replace_token(conflines, "#shared_buffers = 128MB", repltok);
10751075

10761076
#ifdef HAVE_UNIX_SOCKETS
10771077
snprintf(repltok, sizeof(repltok), "#unix_socket_directories = '%s'",

0 commit comments

Comments
 (0)