如何在Postgres.app中降级/拥有以前版本的Postgres DB[英] How to downgrade/have a previous version of Postgres DB in Postgres.app

本文是小编为大家收集整理的关于如何在Postgres.app中降级/拥有以前版本的Postgres DB的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我已经在此处安装了Postgres.app( http://postgresapp.com )几天前.它带有Postgres 9.4.4.

今天,我意识到我使用的软件仅支持Postgres 9.3. 9.4.4版本有效,但有时有DB锁.

有没有一种方法可以降级我当前的DB(非常小,仅用于测试),哪个版本是9.4.4至9.3?还是可以使用9.3版创建另一个DB,而无需卸载当前版本的Postgres.app?

OS:OS X Yosemite 10.10.4

谢谢.

推荐答案

  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 dB /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.创建93 dB /Library/PostgreSQL/9.3/bin/psql -U 93_superuser_user -c "create database IMPORT_DB"
  7. 导入93 db /Library/PostgreSQL/9.3/bin/psql -U 93_superuser_user -f somefile.dmp IMPORT_DB

我不知道此主题是否有文章.我知道我听起来古老的时尚,但也许是手册? :)和经验

其他推荐答案

如果您需要降级Postgres版本,但更喜欢继续使用Postgres.App.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.2. https://github.com/postgres.com/postgres/postgresapp/postgresapp/postgresapp/releleases/tag/tag/tag/tag/v2. 0.2

旧版本的Postgres也有原始问题中引用的9.3系列.

我不确定旧安装程序是否由Postgres.App提供.我在 http://postgresapp.com/上找不到任何提及.刚刚注意到Github上的历史记录.

本文地址:https://www.itbaoku.cn/post/1763831.html

问题描述

I have installed Postgres.app from here (http://postgresapp.com) a couple of days ago. It comes with Postgres 9.4.4.

Today I realised that the software I am using officially supports only Postgres 9.3. The 9.4.4 version works, but sometimes there are DB locks.

Is there a way to downgrade my current db (very small in size, created just for testing), which is version 9.4.4 to 9.3? Or is it possible to create another DB with version 9.3 without uninstalling current version of Postgres.app?

OS: OS X Yosemite 10.10.4

Thank you.

推荐答案

  1. install postgres 9.3 server and client to your mac
  2. run locate initdb expected in /Library/PostgreSQL/9.3/bin/initdb let's assume it is there
  3. create 9.3 instance /Library/PostgreSQL/9.3/bin/initdb -D /new_data_directory
  4. export 9.4 db /Library/PostgreSQL/9.3/bin/pg_dump -U 94_username -d 94_database >somefile.dmp
  5. shutdown old /Library/PostgreSQL/9.4/bin/pg_ctl stop -m fast
  6. startup new /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. import 93 db /Library/PostgreSQL/9.3/bin/psql -U 93_superuser_user -f somefile.dmp IMPORT_DB

I don't know if there are articles on this topic. I know I sound old fashion, but maybe manuals? :) and experience

其他推荐答案

If you need to downgrade the Postgres version but prefer to continue using Postgres.app, there are previous releases recorded at https://github.com/PostgresApp/PostgresApp/releases/ including links to the dmg or older zip installers.

For example in August 2017 the current Postgres.app (v2.0.4) uses Postgres version 9.6.4. However if you needed say Postgres 9.6.2 you could page back through the previous releases to find that the v.2.0.2 release from Feb 2017 uses Postgres 9.6.2. https://github.com/PostgresApp/PostgresApp/releases/tag/v2.0.2

Older versions of Postgres are there too even back to the 9.3 series referenced in the original question.

I'm not sure if the old installers are "officially" provided by Postgres.app. I couldn't find any mention of them on http://postgresapp.com/. Just noticed the releases history on Github.