postgresql - 数据目录由 PostgreSQL 版本 13 初始化,与此版本 14.0 不兼容

标签 postgresql docker debian portainer

我已经将 Portainer 下载到我的服务器上,并在那里的容器中创建了一个 PostgreSQL 数据库。
今天我无法再访问数据库。日志显示一条​​消息,表明存在版本问题。
我已经阅读了一些类似的问题,例如 Postgres container crashes with `database files are incompatible with server` after container's image has been updated to the latest onePostgres container crashes with `database files are incompatible with server` after container's image has been updated to the latest one
和解决方案 brew postgresql-upgrade-database不工作。
我能做什么?
日志

2021-10-03  [1] FATAL:  database files are incompatible with server
2021-10-03  [1] DETAIL:  The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 14.0 (Debian 14.0-1.pgdg110+1).

PostgreSQL Database directory appears to contain a database; Skipping initialization
我也发现了这个 https://www.postgresql.org/docs/14/upgrading.html但命令不起作用。我是否需要以某种方式在容器中执行此操作,或者哪些命令可以使其在容器中运行?

最佳答案

我解决了

  • 删除 postgres 图像
  • 删除卷
  • 再次拉取镜像

  • 假设您知道上述步骤的 docker 命令。

    关于postgresql - 数据目录由 PostgreSQL 版本 13 初始化,与此版本 14.0 不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69424563/

    相关文章:

    SSL:如何在 docker 容器中访问 HTTPS

    mysql - 我的 Docker Wordpress 网站在哪里存储数据?

    Debian 上的 Ubuntu 存储库

    postgresql - 如何在 postgresql 中组合多个 select 语句?

    java - 使用 Hibernate 保存级联

    postgresql - odoo.service.server : Failed to load server-wide module `web`

    node.js - 如何在 sequelize 中关联表格

    docker - 如何在 Docker 中配置 WSO2 API-M 3.0.0 和 API-M Analytics 3.0.0?

    php - 尝试在 Debian 8 v-server 上将 phalcon 更新到 3.0

    python - 在 python 脚本中使用 apt 时如何从标准输出中排除特定消息?