【问题标题】:Can't start postgres due to bad ALTER SYSTEM settings由于 ALTER SYSTEM 设置错误,无法启动 postgres
【发布时间】:2018-07-18 14:19:20
【问题描述】:

我在 ubuntu 16.04 上使用 PostgreSQL 9.6。今天我尝试更改设置中的一些值。通过 pgAdmin 查询工具,我添加了非现有库的使用:

 shared_preload_libraries = 'online_analyze, plantuner'

由于缺少该库,现在 postgres 无法启动,并且我无法回滚此设置,因为我无法访问 psql 或 pgAdmin 中的查询工具(postgres 未启动)。

我能做什么?

【问题讨论】:

  • 它驻留在服务器上

标签: linux postgresql


【解决方案1】:

https://www.postgresql.org/docs/current/static/sql-altersystem.html

ALTER SYSTEM 将给定的参数设置写入 postgresql.auto.conf 文件,除了读取 postgresql.conf

(格式化我的)

因此您可以通过 ssh 访问服务器并手动编辑文件以让 postgres 启动。

您可以通过sudo find / -name postgresql.auto.conf轻松找到它

【讨论】:

  • 我没有这个文件...我需要创建它吗?
  • 它是在您第一次运行 ALTER SYSTEM 时创建的 - 在 $PGDATA 或某些 linux 发行版中查看服务器端 /etc/postgres*/*/,您可以使用 sudo find / -name postgresql.auto.conf 轻松找到它
  • 我在 /var/lib/postgresql/9.6/main/postgresql.auto.conf 中找到了它,非常感谢!
  • 不用担心。尝试删除失败的行,如果有帮助,请投票,最重要的是接受答案 - 它可能会帮助其他人,并且会给我适度的奖金
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-01-08
  • 1970-01-01
  • 2021-05-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多