本文介绍了如何在Postgres.app中降级/拥有Postgres DB的
先前版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
几天前,我已经从此处( postgresapp )安装了Postgres.app。它随Postgres 9.4.4一起提供。
I have installed Postgres.app from here (postgresapp) 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
谢谢。
推荐答案
将postgres 9.3服务器和客户端安装到您的Mac 运行找到initdb 预期在 /Library/PostgreSQL/9.3/bin/ initdb 假设它在那里 创建9.3实例 /Library/PostgreSQL/9.3/bin/initdb -D / new_data_directory 导出9.4 db /Library/PostgreSQL/9.3/bin/pg_dump -U 94_username -d 94_database> somefile.dmp 关闭旧的 /Library/PostgreSQL/9.4/bin/pg_ctl stop -m fast 启动新的 /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 import 93 db /Library/PostgreSQL/9.3/bin/ psql -U 93_superuser_user -f somefile.dmp IMPORT_DB
install postgres 9.3 server and client to your mac
run locate initdb
expected in /Library/PostgreSQL/9.3/bin/initdb let's assume it is there
create 9.3 instance /Library/PostgreSQL/9.3/bin/initdb -D /new_data_directory
export 9.4 db /Library/PostgreSQL/9.3/bin/pg_dump -U 94_username -d 94_database >somefile.dmp
shutdown old /Library/PostgreSQL/9.4/bin/pg_ctl stop -m fast
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"
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
发布评论