是否可以将现有数据库从 Postgres 8.3.3 升级到 8.4.2(安装了 Windows Vista)?

是否可以将现有数据库从 Postgres 8.3.3 升级到 8.4.2(安装了 Windows Vista)?

我正在考虑将我的机器上的 Postgres 8.3.3 升级到 8.4.2(它装有 Windows Vista)。

可以从 enterprisedb.com 下载的 Postgres 8.4.2 的 Windows Installer(一键安装程序)仅提供全新安装(它无法识别我当前安装的 v8.3.3)。

是否可以在升级后立即将现有数据库转换并在新版本中可见(自动迁移?)?或者我必须做更多的事情 - 手动备份/恢复所有数据库?

答案1

简单的回答:您需要 pg_dump,安装全新的 8.4,然后加载。

没有那么简单的答案 - 您可以使用 pg_migrator 进行就地二进制文件升级,但我还没有测试过。

答案2

我已经尝试过 pg_migrator 并且:

  1. 最新版本(8.4.11)不适合我的迁移任务 - 它允许迁移到 8.5 但是我需要迁移到 8.4.2。

    Performing Consistency Checks Checking old data directory (c:\program files\postgresql\8.3\data)ok Checking new data directory (c:\program files\postgresql\8.4\data)ok

    This binary was built using 8.5 PostgreSQL sources; it must be built using 8.4 PostgreSQL sources to match the new cluster.

但是... pg_migrator 主页上没有关于迁移器版本适用于 Postgres 目标版本的信息。我已经下载并安装了 v8.4.4,它看起来是正确的版本,但我说的是:

mapped win32 error code 2 to 2 Old and new pg_controldata date/time storage types do not match.

You will need to rebuild the new server with configure --disable-integer-datetimes or get server binaries built with those options.

所以,对我来说它不是那么自动化。我认为经典的 pg_dump / restore 会更好。

相关内容