pgAdmin 使用无效的数据库名称启动 pg_restore
在 Ubuntu 11.04 64 位上新安装 PostgreSQL 和 pgAdmin。
在使用 pgAdmin 恢复数据库模式时,它会启动以下命令:
/usr/bin/pg_restore --host opusdb --port 5432 --username postgres --dbname \"mydb\" --verbose "mydb.backup"
pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database ""mydb"" failed: FATAL: database ""mydb"" does not exist
pg_restore: *** aborted because of error
Process returned exit code 1.
问题是由于数据库名称前后的 \" 造成的。以下内容在命令行上有效(注意缺少 \ 字符):
/usr/bin/pg_restore --host opusdb --port 5432 --username postgres --dbname "mydb" --verbose "mydb.backup"
不确定 pgAdmin 是否突然出现使用不同的语法,或者 pg_restore 不再理解 \" 。是否与 64 位 Ubuntu 安装有任何关系?
New install of PostgreSQL and pgAdmin on Ubuntu 11.04 64-bit.
On restoring a database schema with pgAdmin, it launches the following command:
/usr/bin/pg_restore --host opusdb --port 5432 --username postgres --dbname \"mydb\" --verbose "mydb.backup"
pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database ""mydb"" failed: FATAL: database ""mydb"" does not exist
pg_restore: *** aborted because of error
Process returned exit code 1.
The problem is due to the \" before and after the database name. The following works on the command line (note the absent \ characters):
/usr/bin/pg_restore --host opusdb --port 5432 --username postgres --dbname "mydb" --verbose "mydb.backup"
Not sure if pgAdmin is suddenly using a different syntax, or pg_restore doesn't understand the \" anymore. Could it be in any way related to the 64-bit installation of Ubuntu?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然这是特定 pgadmin3 版本的问题: osdir.com/ml/ ubuntu-bugs/2011-05/msg30089.html
下一个版本应该不会再有这个问题了。
Obviously this is a problem with the particular pgadmin3 version: osdir.com/ml/ubuntu-bugs/2011-05/msg30089.html
The next version shouldn't have this problem anymore.