PGPASSWORD=mypassword pg_dumpall -h mydbname.postgres.database.azure.com -p 5432 -U admin@mydbname
pg_dump: [archiver (db)] connection to database "azure_maintenance" failed: FATAL: permission denied for database "azure_maintenance" DETAIL: User does not have CONNECT privilege. pg_dumpall: pg_dump failed on database "azure_maintenance", exiting
如何备份 Azure Postgresql 托管服务中的所有数据库?
最佳答案
从 PostgreSQL 12.0 开始,pg_dumpall 有一个 --exclude-database
选项(请参阅 Release Notes )。
以下应该有效:
pg_dumpall -h mydbname.postgres.database.azure.com -p 5432 -U admin@mydbname --exclude-database=azure* --clean --file=dump.sql
关于postgresql - pg_dumpall - Azure Database for PostgreSQL - 数据库 "azure_maintenance"的权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56165163/