图1:
[highgo@baidu data]$ pg_ctl start
等待服务器进程启动 ....2020-11-03 17:19:24.800 CST [113539] LOG: starting HighGo Database 6 Release 6.0.0-64-bit Production
2020-11-03 17:19:24.801 CST [113539] LOG: listening on IPv4 address "0.0.0.0", port 5866
2020-11-03 17:19:24.801 CST [113539] LOG: listening on IPv6 address "::", port 5866
2020-11-03 17:19:24.802 CST [113539] LOG: listening on Unix socket "/tmp/.s.PGSQL.5866"
2020-11-03 17:19:24.827 CST [113539] LOG: This is a trial edition, validate until 2021-10-10 14:21:05, database will not be able to start up after that time,please apply an official license by that time.
2020-11-03 17:19:24.924 CST [113540] LOG: database system was shut down at 2020-11-03 17:19:20 CST
2020-11-03 17:19:24.929 CST [113539] LOG: database system is ready to accept connections
完成
服务器进程已经启动
我在linux 启动postgres数据库,返回的内容有中英文混合,所以做了个测试。
结论:
返回信息分为上下两块。
1、postgres打印信息内容
....2020-11-03 17:19:24.800 CST [113539] LOG: starting HighGo Database 6 Release 6.0.0-64-bit Production
2020-11-03 17:19:24.801 CST [113539] LOG: listening on IPv4 address "0.0.0.0", port 5866
2020-11-03 17:19:24.801 CST [113539] LOG: listening on IPv6 address "::", port 5866
2020-11-03 17:19:24.802 CST [113539] LOG: listening on Unix socket "/tmp/.s.PGSQL.5866"
2020-11-03 17:19:24.827 CST [113539] LOG: This is a trial edition, validate until 2021-10-10 14:21:05, database will not be able to start up after that time,please apply an official license by that time.
2020-11-03 17:19:24.924 CST [113540] LOG: database system was shut down at 2020-11-03 17:19:20 CST
2020-11-03 17:19:24.929 CST [113539] LOG: database system is ready to accept connections
2、os调用命令返回内容
完成
服务器进程已经启动
这样看的话就很容易理解了。
修改方法:
1、pg打印信息,修改postgresql.conf ,搜索/lc_messages,我们把属性改成中文
#vi postgresql.conf
#/lc_messages
lc_messages = 'zh_CN.utf8'
2、修改os字符集,临时生效使用export
export LANG=en_US.UTF-8
3、再次启动
[highgo@baidu data]$ pg_ctl start
waiting for server to start....2020-11-03 17:28:20.446 CST [114078] 日志: 正在启动 HighGo Database 6 Release 6.0.0-64-bit Production
2020-11-03 17:28:20.447 CST [114078] 日志: 正在监听IPv4地址"0.0.0.0",端口 5866
2020-11-03 17:28:20.447 CST [114078] 日志: 正在监听IPv6地址"::",端口 5866
2020-11-03 17:28:20.448 CST [114078] 日志: 在Unix套接字 "/tmp/.s.PGSQL.5866"上侦听
2020-11-03 17:28:20.480 CST [114078] 日志: This is a trial edition, validate until 2021-10-10 14:21:05, database will not be able to start up after that time,please apply an official license by that time.
2020-11-03 17:28:20.596 CST [114079] 日志: 数据库上次关闭时间为 2020-11-03 17:28:07 CST
2020-11-03 17:28:20.600 CST [114078] 日志: 数据库系统准备接受连接
done
server started
这样就和图1完全相反了