pg_dump:[存档(db)]查询失败:错误:拒绝关于关系的权限 [英] pg_dump: [archiver (db)] query failed: ERROR: permission denied for relation abouts

查看:525
本文介绍了pg_dump:[存档(db)]查询失败:错误:拒绝关于关系的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试转储我的pg db,但是遇到这些错误,请提出建议

I'm trying to dump my pg db but got these errors please suggest

pg_dump: [archiver (db)] query failed: ERROR:  permission denied for relation abouts
pg_dump: [archiver (db)] query was: LOCK TABLE public.abouts IN ACCESS SHARE MODE


推荐答案

使用 ROLE (用户)时,这可能是一个常见错误。

This can be a common error, when using a ROLE (user) that could not open the objects to dump them.

就像以前说过的那样,您可以授予要转储的特定模式,甚至可以使用具有属性的角色

Like said before, you can grant to the specific schema that you want to dump, or even use a ROLE with SUPERUSER attribute.

请注意,当您处理一些云数据库提供程序,例如AWS / RDS,您将不会收到具有 SUPERUSER 属性的用户,因此您将需要确保用于转储的用户具有所有

Note that when you are dealing with some cloud database providers, like AWS/RDS you will not receive a user with the SUPERUSER attribute, so you will need to manage to make sure that the one used to dump will have all access needed.

https://www.postgresql.o rg / docs / current / static / sql-grant.html 将显示如何为数据库中的许多对象提供 GRANT ,但还要记住,还原时首先需要创建数据库。仅当您不需要使用 pg_dumpall 时,您才需要转储 ROLES

https://www.postgresql.org/docs/current/static/sql-grant.html will show how give GRANT to many objects on your database, but also remember that when restoring you will need to create the database first. Only if you are using pg_dumpall that is not necessary, but you also need to dump the ROLES.

这篇关于pg_dump:[存档(db)]查询失败:错误:拒绝关于关系的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆