PG的启停是在操作系统层面进行。
1.PG启动:
pg@dmdb04-> pg_ctl start
waiting for server to start…2019-11-29 15:21:40.981 CST [74098] LOG: 00000: starting PostgreSQL 12beta2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16), 64-bit
2019-11-29 15:21:40.981 CST [74098] LOCATION: PostmasterMain, postmaster.c:998
2019-11-29 15:21:40.981 CST [74098] LOG: 00000: listening on IPv4 address “0.0.0.0”, port 1921
2019-11-29 15:21:40.981 CST [74098] LOCATION: StreamServerPort, pqcomm.c:593
2019-11-29 15:21:40.981 CST [74098] LOG: 00000: listening on Unix socket “./.s.PGSQL.1921”
2019-11-29 15:21:40.981 CST [74098] LOCATION: StreamServerPort, pqcomm.c:587
2019-11-29 15:21:41.003 CST [74098] LOG: 00000: redirecting log output to logging collector process
2019-11-29 15:21:41.003 CST [74098] HINT: Future log output will appear in directory “log”.
2019-11-29 15:21:41.003 CST [74098] LOCATION: SysLogger_Start, syslogger.c:675
done
server started
2.PG的关闭:
pg@dmdb04-> pg_ctl stop
waiting for server to shut down… done
server stopped