阻止PostgreSQL在Ubuntu中启动时启动

我正在使用Postgresql 9.2,它在我启动系统时自动运行(Kubuntu).

我怎么能避免这个?

我需要手动启动它,我不希望它无人值守,因为我需要查看控制台.

Ubuntu或Debian可以运行Postgresql的多个实例,并提供自动启动/停止/启动每个群集的特定方法.

在/etc/postgresql/9.2/main(或更一般地说是/ etc / postgresql /< version> /< clustername>)中应该有一个名为start.conf的文件,其中包含以下不言自明的内容

# Automatic startup configuration
# auto: automatically start/stop the cluster in the init script
# manual: do not start/stop in init scripts,but allow manual startup with
#         pg_ctlcluster
# disabled: do not allow manual startup with pg_ctlcluster (this can be easily
#           circumvented and is only meant to be a small protection for
#           accidents).

auto

如果您通过手动替换auto,则只能在需要时使用以下命令启动此Postgresql实例:

sudo pg_ctlcluster 9.2 main start

至于查看控制台,您需要的是在使用数据库时在终端中运行:

tail -f /var/log/postgresql/postgresql-9.2-main.log

相关文章

项目需要,有个数据需要导入,拿到手一开始以为是mysql,结果...
本文小编为大家详细介绍“怎么查看PostgreSQL数据库中所有表...
错误现象问题原因这是在远程连接时pg_hba.conf文件没有配置正...
因本地资源有限,在公共测试环境搭建了PGsql环境,从数据库本...
wamp 环境 这个提示就是说你的版本低于10了。 先打印ph...
psycopg2.OperationalError: SSL SYSCALL error: EOF detect...