在CentOS 7下,你可以通过以下步骤来查看和启动PostgreSQL版本和服务:


查看PostgreSQL版本:打开终端,运行以下命令来查看已安装的PostgreSQL版本:


Copypsql --version

启动PostgreSQL服务:运行以下命令来启动PostgreSQL服务:


Copysudo systemctl start postgresql

如果你想在系统启动时自动启动PostgreSQL服务,可以运行以下命令:


Copysudo systemctl enable postgresql

如果服务已经在运行中,你可以使用以下命令重新加载配置文件:


Copysudo systemctl reload postgresql

停止PostgreSQL服务:运行以下命令来停止PostgreSQL服务:


Copysudo systemctl stop postgresql

如果你想禁用系统启动时自动启动PostgreSQL服务,可以运行以下命令:


Copysudo systemctl disable postgresql

希望对你有所帮助!如果你有任何其他问题,请随时提问。