最近我使用了这个命令来备份我的PostgreSQL数据库
pg_dumpall > BkpOldPG.sql
在卸载旧版本的Postgres之后,我下载了最新版本9.4,并尝试使用以下命令恢复我的旧数据:
mody@debian:~$ su postgres
Password:
postgres@debian:/home/mody$
postgres@debian:/home/mody$ /usr/lib/postgresql/9.4/bin/psql -d postgres -f Documents/Bkp01dPg.sql
Documents/Bkp01dPg.sql: Permission denied
您可以看到,我收到了Permission denied
的错误提示,因此我尝试使用sudo
,但它没有起作用:
postgres@debian:/home/mody$ sudo /usr/lib/postgresql/9.4/bin/psql -d postgres -f Documents/Bkp01dPg.sql
[sudo] password for postgres:
postgres is not in the sudoers file. This incident will be reported.
请问有什么需要帮助的吗?
谢谢!