我在现有的数据库服务器上运行了以下命令:
pg_dump -C -U testuser testdb -h 127.0.0.1 -F t> testdbdump
现在我正在尝试在新服务器上创建这个 testdb。我尝试在新服务器上运行以下命令:
pg_restore -h 127.0.0.1 testdbdump
我在新的数据库服务器上创建了 testuser 角色。然后我还尝试了以下方法:
pg_restore -i -h 127.0.0.1 -p 5432 -U postgres "testdbdump"
psql template1 postgres -f testdbdump
它确实开始做一些事情,但我得到了一堆错误,包括:
psql:testdbdump:1720: invalid command \N
psql:testdbdump:1721: invalid command \N
psql:testdbdump:1808: ERROR: syntax error at or near "user"
LINE 1: user=phone
^
我是否错误地创建了转储文件?