Postgres-选择的新角色显示空表,而超级用户角色在同一表中显示数据
感谢您抽出宝贵的时间尝试回答/理解这个问题。
我正在使用AWS Aurora Postgres(发动机版本:13.4)数据库。 我提到此文档 readwrite
和readonly
2个新的rdsiam
用户 - > “ dev_ro”和“ dev_rw”。我已将readwrite
角色授予“ dev_rw”和readonly
to“ dev_ro”。附加更改是:
mySchema
是“ public” - 这是我的默认模式,- 我将与“ myschema”相同的权限添加到另一个称为“ graphile_worker”的模式(来自 flage/worker - 是工作队列)。
考虑到这一点,这是我所做的:
- 我运行的应用程序添加了一些重复的作业(作业计划本身),这意味着
作业
表无法 - 使用IAM用户使用表表可以空置为RDS (没关系dev_ro或dev_rw)
- 在我的IDE(dbeaver-没关系,我认为)
- 我
- 运行
select * select * from graphile_worker.jobs
使用Superuser凭据(创建服务器时创建的) - 运行与上面的查询相同
- ,请参见表中的数据,
我不知道为什么会发生这种情况。 我仔细检查了“ Dev_ro/W”(通过角色)和Superuser,都具有:
连接到数据库(毫无疑问)
在所有
graphile_worker 架构的表上选择
select用法
在graphile_worker
架构中- ,我可以查询
graphile_worker.migrations.migrations.migrations
,迁移记录按预期显示(on devro/W和Superuser)!
请让我知道是否还有更多信息可以帮助您调试此问题。
thank for taking the time to try answer/understand this question.
I am using AWS Aurora Postgres (Engine version: 13.4) database.
I referred to this document for creating readwrite
and readonly
roles for 2 new rdsiam
users -> "dev_ro" and "dev_rw". I have granted readwrite
role to "dev_rw" and readonly
to "dev_ro". The additional changes are:
myschema
is "public" - which is my default schema- I add the same permissions as "myschema" to another schema called "graphile_worker" (from graphile/worker - which is a job queue).
With this in mind, here is what I have done:
- I run my application which adds some repeating jobs (jobs schedule itself), implying that the
jobs
table can never be empty - Connect to RDS using the IAM user (doesn't matter dev_ro or dev_rw)
- I run
SELECT * FROM graphile_worker.jobs
in my IDE (dbeaver - shouldn't matter, I think) - The table shows up empty
- Disconnect and Re-connect to RDS using superuser credentials (which are created when server is created)
- Run same query as above
- See data in the table
I don't know why this is happening.
I double-checked, both "dev_ro/w" (through the roles) and superuser, have:
CONNECT
to database (without doubt)SELECT
on all tables ofgraphile_worker
schemaUSAGE
on thegraphile_worker
schema- Moreover, I can query
graphile_worker.migrations
and the migration records show up as expected (on both devro/w and superuser)!
Please let me know if there is any more information that I can provide to help debug this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
删除行级安全性(RLS)解决了此问题。
感谢@hambone提出正确的问题。
通过执行删除RLS
Removing Row-Level Security (RLS) solved this issue.
Thanks @Hambone for asking the right question.
RLS is removed by executing