我需要进行新安装,我需要从当前安装中复制我的数据库。我需要远程服务器到本地机器的 pg_dumpall 命令。
我已经尝试过了,但它只适用于转储,不适用于转储
pg_dump -h hostname -Fc -o -U username database > databaseall.sql
和
pg_dumpall -h hostname -p 5432 -U username > databaseall.sql
给出错误
pg_dumpall: query failed: ERROR: permission denied for relation pg_authid
pg_dumpall: query was: SELECT oid, rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcanlogin, rolconnlimit, rolpassword, rolvaliduntil, rolreplication, rolbypassrls, pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, rolname = current_user AS is_current_user FROM pg_authid ORDER BY 2
和
pg_dumpall -h hostname -p 5432 -U username -c -o -f "databaseall.sql"
给出错误
pg_dumpall: query failed: ERROR: permission denied for relation pg_authid
pg_dumpall: query was: SELECT rolname FROM pg_authid ORDER BY 1