来自 pgadmin3 的 pg_restore 错误 - Postgresql
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19134691/
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
pg_restore error from pgadmin3 - Postgresql
提问by Sangram Anand
I have taken a backup of a Postgresql db from a system1 using pgadmin3 tool. The backup file created is of extension ".backup"
我使用 pgadmin3 工具从 system1 备份了 Postgresql 数据库。创建的备份文件的扩展名为“.backup”
I am trying to restore it on an another system2 installed with postgresql 9.0 and pgadmin3 1.8 But I am getting the error:
我试图在安装了 postgresql 9.0 和 pgadmin3 1.8 的另一个 system2 上恢复它,但我收到错误:
could not execute query: ERROR: unrecognized configuration parameter "lock_timeout" Command was: SET lock_timeout = 0;
无法执行查询:错误:无法识别的配置参数“lock_timeout” 命令为:SET lock_timeout = 0;
Configuration of both the systems:
两个系统的配置:
system1 win7-64bit postgresql 9.0.13-1 - 64bit pgadmin 1.8
system1 win7-64 位 postgresql 9.0.13-1 - 64 位 pgadmin 1.8
system2 win7-32bit postgresql 9.0.13-1 - 32bit pgadmin 1.8
system2 win7-32 位 postgresql 9.0.13-1 - 32 位 pgadmin 1.8
回答by Jon Richardson
By default, pgAdmin uses it's own binaries, which in this case may be higher (or lower) than the version of PostgreSQL you're working with. You can configure pgAdmin to use the binaries from a local installation of PostgreSQL, if your database is local. If the database you are working with is remote, you may consider installing a copy of that version of PostgreSQL locally, so you can use the binaries.
默认情况下,pgAdmin 使用它自己的二进制文件,在这种情况下,它可能高于(或低于)您正在使用的 PostgreSQL 版本。如果您的数据库是本地的,您可以将 pgAdmin 配置为使用 PostgreSQL 本地安装中的二进制文件。如果您使用的数据库是远程的,您可以考虑在本地安装该版本 PostgreSQL 的副本,以便您可以使用二进制文件。
In Preferences -> Browser -> Binary paths, set the PG bin pathto be the path to your local installation of PostgreSQL (or any local install, as long as it is the same version as the database).
在Preferences -> Browser -> Binary paths 中,将PG bin 路径设置为 PostgreSQL 本地安装的路径(或任何本地安装,只要它与数据库版本相同)。
Configuring a new location for the PG binaries is best if you primarily work with a single version of PostgreSQL at a time, and are using the latest pgAdmin. However, if you use multiple versions of PostgreSQL simultaneously, using the command line may be better. Personally, in that case, I still use pgAdmin to start the restore and let it error out, then use the command line flags that the gui built (which you can find in the log file) to copy and paste into my terminal program (you may have to remove the --no-passwordflag).
如果您主要一次使用单个版本的 PostgreSQL,并且使用最新的 pgAdmin,则最好为 PG 二进制文件配置一个新位置。但是,如果您同时使用多个版本的 PostgreSQL,使用命令行可能会更好。就个人而言,在这种情况下,我仍然使用 pgAdmin 来启动恢复并让它出错,然后使用 gui 构建的命令行标志(您可以在日志文件中找到)复制并粘贴到我的终端程序中(您可能必须删除--no-password标志)。
回答by Chris Travers
The lock_timeout was introduced in 9.3. This sounds like a problem with pgAdmin. It would be worth reporting as a bug.
lock_timeout 是在 9.3中引入的。这听起来像是 pgAdmin 的问题。值得报告为错误。
As a workaround, you might try restoring with a command line client (psql for a text backup, pg_restore for a non-text logical backup).
作为一种解决方法,您可以尝试使用命令行客户端进行恢复(psql 用于文本备份,pg_restore 用于非文本逻辑备份)。