8

几天前,我从这里( 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 X 优胜美地 10.10.4

谢谢你。

4

2 回答 2

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

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

于 2015-07-07T06:47:51.823 回答
0

如果您需要降级 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,您可以翻页查看以前的版本,以发现v.2.0.22017 年 2 月的版本使用 Postgres 9.6.2https://github.com/PostgresApp/PostgresApp/releases/tag/v2.0.2

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

我不确定旧安装程序是否由 Postgres.app “官方”提供。我在http://postgresapp.com/上找不到任何提及它们的内容。刚刚注意到 Github 上的发布历史。

于 2017-08-24T15:51:01.823 回答