[pg104@dbserver pgsqldata]$ pg_ctl start
waiting for server to start....2018-12-20 06:28:52.359 GMT [4317] LOG: skipping missing configuration file "/pgsqldata/postgresql.auto.conf"
2018-12-20 01:28:52.364 EST [4317] LOG: listening on IPv4 address "0.0.0.0", port 5432
2018-12-20 01:28:52.365 EST [4317] LOG: listening on IPv6 address "::", port 5432
2018-12-20 01:28:52.367 EST [4317] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2018-12-20 01:28:52.394 EST [4317] LOG: redirecting log output to logging collector process
2018-12-20 01:28:52.394 EST [4317] HINT: Future log output will appear in directory "log".
done
server started
[pg104@dbserver pgsqldata]$ egrep -i max_connections postgresql.conf
max_cOnneCtioNs = 173 # (change requires restart) ——>>注意参数名称是大小写混杂的
[pg104@dbserver pgsqldata]$ psql -d postgres
psql (10.4)
Type "help" for help.
postgres=# \x
Expanded display is on.
postgres=# select * from pg_settings where name ='max_connections';
-[ RECORD 1 ]---+-----------------------------------------------------
name | max_connections
setting | 173
unit |
category | Connections and Authentication / Connection Settings
short_desc | Sets the maximum number of concurrent connections.
extra_desc |
context | postmaster
vartype | integer
source | configuration file
min_val | 1
max_val | 262143
enumvals |
boot_val | 100
reset_val | 173
sourcefile | /pgsqldata/postgresql.conf
sourceline | 65
pending_restart | f
postgres=# select * from pg_settings where name ='maX_connections';
(0 rows)
postgres=# show max_connections ;
-[ RECORD 1 ]---+----
max_connections | 173
postgres=#
在postgresql.conf中,我敲入的参数名称是“max_cOnneCtioNs”(此时参数值是173),注意是大小写混杂的字母,
然后pg cluster起来之后,去查询pg_settings视图,发现如下:
1. 参数名称是全小写的max_connections
2.参数值已经变成了173
这说明如下问题:
pg数据库软件读取$PGDATA/postgresql.conf时,对postgresql.conf中的max_cOnneCtioNs参数名称,是转为全小写,然后写入pg_settings视图的。