我更新了一些Cygwin软件包,现在我无法启动Postgres:
$ /usr/sbin/postmaster FATAL: database files are incompatible with server DETAIL: The data directory was initialized by PostgreSQL version 8.2, which is not compatible with this version 9.2.4.
我试过pg_upgrade,但是你需要指定旧的和新的二进制文件。 另外,pg_upgrade说它只能用于8.3。
我以为我可以使用setup-x86.exe来select以前的版本,这是8.2.11-1,但是当我安装,然后我无法启动Postgres:
$ /usr/sbin/postgres.exe Bad system call (core dumped)
- 卸载postgres 9
- 安装postgres 8.2
- 安装libpq
- /etc/rc.d/init.d/postgresql启动
- 为每个数据库执行此操作:
- pg_dump -f stocks.sql.gz -Z 9-C股票
- /etc/rc.d/init.d/postgresql停止
- cd $ PGDATA / ..#/ usr / share / postgresql / ..
- mv postgresql postgresql-8.2
- 安装postgres 9,postgresql-contrib,卸载libpq。
- /usr/sbin/pg_ctl.exe初始化
- /usr/sbin/pg_ctl.exe启动
- createdb.exe#用你的用户名创build一个数据库
- gzip -dc stocks.sql.gz | psql#很多警告+错误
从9.2升级到9.3
- 阅读有关升级Postgres的信息: http : //www.postgresql.org/docs/current/static/upgrading.html
- 如果必须安装旧版本的Postgres。 有人维护一个Cygwin版本的历史档案。
- 浏览您需要的setup.ini文件的时间戳: ftp : //www.fruitbat.org/pub/cygwin/circa/index.html
- 复制文件夹的FTP地址(不是index.html)
- 使用
-X选项运行/setup-x86.exe -X以忽略安装签名(它们不存档)。
- 将FTP地址粘贴到对话框中以select您的下载网站。 然后,您将看到在此期间可用的包的快照。
- 重新启动cygserver,如果你closures升级:以pipe理员
cygrunsrv -S cygserver运行: cygrunsrv -S cygserver
- 启动旧版本的Postgres:
/usr/sbin/postmaster &或/usr/sbin/pg_ctl start
- 将数据库转储到
pg_dumpall > /tmp/pg.sql的临时文件中
- closuresPostgres
/usr/sbin/pg_ctl.exe stop
- 移动旧数据目录
mv /usr/share/postgresql /usr/share/postgresql-9.2
- 正常运行安装程序并安装最新的Postgres。 请确保select您的正常下载网站。
- 初始化DB
/usr/sbin/pg_ctl init
- 启动新版本的Postgres
/usr/sbin/pg_ctl.exe start
- 导入旧的数据库
psql -d postgres -f /tmp/pg.sql