我一直在尝试导入 postgres 转储(psql dbname < dump.sql
及其变体,指定主机名和用户名等),但到目前为止我一直没有成功。
我是 Postgres 的新手,所以我可能在这里错过了明显的东西。根据导入命令的输出,扩展 plpgsql 可能不存在。我应该在导入之前设置 plpgsql 扩展吗?
以下是输出的前几行:
SET
ERROR: unrecognized configuration parameter "lock_timeout"
SET
SET
SET
SET
CREATE EXTENSION
ERROR: must be owner of extension plpgsql
ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory
ERROR: extension "hstore" does not exist
SET
SET
SET
ERROR: relation "active_admin_comments" already exists
ERROR: role "finalstep" does not exist
ERROR: relation "active_admin_comments_id_seq" already exists
ERROR: role "finalstep" does not exist
ALTER SEQUENCE
ERROR: relation "admin_users" already exists
ERROR: role "finalstep" does not exist
后来,看起来它正在尝试将一些内容作为 sql 查询执行(内容包含 mathml 标记):
ERROR: syntax error at or near "</"
LINE 1: </mo> <msqrt>
^
ERROR: syntax error at or near "&"
LINE 1:
^
ERROR: syntax error at or near "</"
LINE 1: </mi> <mi>α
任何指针?我的 Postgres 版本是 9.1(最初是 9.3,但在看到错误消息后我将其降级为 9.1)。