如何 downgrade/have Postgres.app 以前版本的 Postgres DB

How to downgrade/have a previous version of Postgres DB in Postgres.app

我几天前从这里 (http://postgresapp.com) 安装了 Postgres.app。它带有 Postgres 9.4.4.

今天才发现我用的软件官方只支持Postgres 9.3。 9.4.4版本可以,但有时会出现DB锁。

有没有办法将我当前的数据库(非常小,仅为测试而创建)从 9.4.4 版本降级到 9.3?或者是否可以在不卸载当前版本 Postgres.app 的情况下使用 9.3 版创建另一个数据库?

OS: OS X Yosemite 10.10.4

谢谢。

  1. 为您的 mac
  2. 安装 postgres 9.3 服务器和客户端
  3. 运行 locate initdb 预计在 /Library/PostgreSQL/9.3/bin/initdb 让我们假设它在那里
  4. 创建 9.3 实例 /Library/PostgreSQL/9.3/bin/initdb -D /new_data_directory
  5. 导出 9.4 分贝 /Library/PostgreSQL/9.3/bin/pg_dump -U 94_username -d 94_database >somefile.dmp
  6. 关闭旧 /Library/PostgreSQL/9.4/bin/pg_ctl stop -m fast
  7. 启动新/Library/PostgreSQL/9.3/bin/pg_ctl start 7.create 93 分贝 /Library/PostgreSQL/9.3/bin/psql -U 93_superuser_user -c "create database IMPORT_DB"
  8. 导入 93 db /Library/PostgreSQL/9.3/bin/psql -U 93_superuser_user -f somefile.dmp IMPORT_DB

不知道有没有这方面的文章。我知道我听起来很老套,但也许是手册? :) 和经验

如果您需要降级 Postgres 版本但更愿意继续使用 Postgres.app,https://github.com/PostgresApp/PostgresApp/releases/ 中记录了以前的版本,包括指向 dmg 或更早 zip 的链接] 安装人员。

例如 2017 年 8 月当前 Postgres.app (v2.0.4) 使用 Postgres 版本 9.6.4。但是,如果您需要说 Postgres 9.6.2,您可以翻阅以前的版本,发现 2017 年 2 月的 v.2.0.2 版本使用 Postgres 9.6.2https://github.com/PostgresApp/PostgresApp/releases/tag/v2.0.2

旧版本的 Postgres 甚至可以追溯到原始问题中引用的 9.3 系列。

我不确定旧安装程序是否由 Postgres.app 提供 "officially"。我在 http://postgresapp.com/ 上找不到任何提及它们的地方。刚刚注意到 Github.

上的发布历史记录