查看服务的状态
[root@localhost]# ps -ef | grep postgres
[root@localhost]# systemctl status postgresql-版本号.service
启动,停止,重启服务
systemctl start postgresql-版本号.service
systemctl stop postgresql-9.4.service
systemctl restart postgresql-9.4.service
查看服务是否开机启动
[root@localhost bin]# systemctl is-enabled postgresql-12.service
enabled
开机时启用一个服务
systemctl enable postgresql-9.4.service
开机时关闭一个服务
systemctl disable postgresql-9.4.service