[英]pg_restore error from pgadmin3 - Postgresql
I have taken a backup of a Postgresql db from a system1 using pgadmin3 tool. 我使用pgadmin3工具从system1备份了Postgresql数据库。 The backup file created is of extension ".backup" 创建的备份文件扩展名为“.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-64bit postgresql 9.0.13-1 - 64bit pgadmin 1.8
system2 win7-32bit postgresql 9.0.13-1 - 32bit pgadmin 1.8 system2 win7-32bit postgresql 9.0.13-1 - 32bit pgadmin 1.8
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. 默认情况下,pgAdmin使用它自己的二进制文件,在这种情况下,它可能比您正在使用的PostgreSQL版本更高(或更低)。 You can configure pgAdmin to use the binaries from a local installation of PostgreSQL, if your database is local. 如果数据库是本地数据库,则可以将pgAdmin配置为使用PostgreSQL本地安装中的二进制文件。 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. 如果您使用的数据库是远程的,您可以考虑在本地安装该版本的PostgreSQL的副本,以便您可以使用二进制文件。
In Preferences -> Browser -> Binary paths , set the PG bin path to be the path to your local installation of PostgreSQL (or any local install, as long as it is the same version as the database). 在首选项 - >浏览器 - >二进制路径中 ,将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. 如果您主要使用单个版本的PostgreSQL,并且使用最新的pgAdmin,则最好为PG二进制文件配置新位置。 However, if you use multiple versions of PostgreSQL simultaneously, using the command line may be better. 但是,如果同时使用多个版本的PostgreSQL,使用命令行可能会更好。 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-password flag). 就个人而言,在这种情况下,我仍然使用pgAdmin启动还原并让它出错,然后使用gui构建的命令行标志(可以在日志文件中找到)复制并粘贴到我的终端程序中(你可能必须删除--no-password标志)。
The lock_timeout was introduced in 9.3 . lock_timeout 在9.3中引入 。 This sounds like a problem with pgAdmin. 这听起来像是pgAdmin的问题。 It would be worth reporting as a bug. 作为一个错误报告是值得的。
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用于非文本逻辑备份)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.