postgresql pg_dump:由于服务器版本不匹配而中止

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45051633/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 02:36:12  来源:igfitidea点击:

pg_dump: aborting because of server version mismatch

postgresqlubuntu-14.04database-backupspostgresql-9.4pg-dump

提问by Naveen Kumar

I am running ubuntu 14.04. while backing up a database on postgreSQL i am following error:

我正在运行 ubuntu 14.04。在 postgreSQL 上备份数据库时出现以下错误:

/usr/bin/pg_dump --host 127.0.0.1 --port 5432 --username "postgres" --no-password  --format custom --section pre-data --section data --section post-data --verbose --file "/home/naveen/consumerDB/CONSUMER_DB" "CONSUMER_DB"
pg_dump: server version: 9.4.8; pg_dump version: 9.3.17
pg_dump: aborting because of server version mismatch

Process returned exit code 1.

Can anyone please help. I tried many other stack overflow links but nothing seems to be working.

任何人都可以请帮忙。我尝试了许多其他堆栈溢出链接,但似乎没有任何效果。

回答by Craig Ringer

The error message seems fairly clear. pg_dumpfor PostgreSQL 9.3 won't dump a PostgreSQL 9.4 database. Maybe you need to run pg_dumpfrom PostgreSQL 9.4?

错误信息似乎相当清楚。pg_dump对于 PostgreSQL 9.3 不会转储 PostgreSQL 9.4 数据库。也许您需要pg_dump从 PostgreSQL 9.4运行?

If you installed both from packages you'll be using pg_wrapperand should use Debian/Ubuntu's update-alternativesto change pg_dumpto point to 9.4's pg_dump. Or run it via the direct path to the actual binary.

如果您从将要使用的软件包中安装了这两个软件包,pg_wrapper并且应该使用 Debian/Ubuntu 将update-alternatives其更改pg_dump为指向 9.4 的pg_dump. 或者通过实际二进制文件的直接路径运行它。

See also https://help.ubuntu.com/community/PostgreSQL

另请参阅https://help.ubuntu.com/community/PostgreSQL