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

查看:102
本文介绍了如何在Postgres.app中降级/拥有Postgres DB的先前版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我已经从此处( http://postgresapp.com )安装了Postgres.app。它随Postgres 9.4.4一起提供。

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

今天,我意识到我所使用的软件仅正式支持Postgres 9.3。 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.

有没有办法降级我当前的数据库(尺寸很小,只是为了测试而创建的),从9.4.4到9.3是哪个版本?还是可以在不卸载Postgres.app当前版本的情况下创建另一个版本9.3的数据库?

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

OS: OS X Yosemite 10.10.4

谢谢。

推荐答案


  1. 将postgres 9.3服务器和客户端安装到您的Mac

  2. 运行找到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.create 93 db /Library/PostgreSQL/9.3 / bin / psql -U 93_superuser_user -c创建数据库IMPORT_DB

  7. import 93 db /Library/PostgreSQL/9.3/bin/ psql -U 93_superuser_user -f somefile.dmp IMPORT_DB

  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

这篇关于如何在Postgres.app中降级/拥有Postgres DB的先前版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆