如何在Postgres.app中降级/拥有Postgres DB的先前版本

编程入门 行业动态 更新时间:2024-10-28 14:24:51
本文介绍了如何在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

    更多推荐

    如何在Postgres.app中降级/拥有Postgres DB的先前版本

    本文发布于:2023-10-18 05:58:42,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1503335.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:先前   版本   如何在   app   Postgres

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!