Postgres-选择的新角色显示空表,而超级用户角色在同一表中显示数据

发布于 2025-01-23 07:59:26 字数 1385 浏览 0 评论 0原文

感谢您抽出宝贵的时间尝试回答/理解这个问题。

我正在使用AWS Aurora Postgres(发动机版本:13.4)数据库。 我提到此文档 readwritereadonly 2个新的rdsiam用户 - > “ dev_ro”和“ dev_rw”。我已将readwrite角色授予“ dev_rw”和readonly to“ dev_ro”。附加更改是:

  1. mySchema是“ public” - 这是我的默认模式,
  2. 我将与“ myschema”相同的权限添加到另一个称为“ graphile_worker”的模式(来自 flage/worker - 是工作队列)。

考虑到这一点,这是我所做的:

  1. 我运行的应用程序添加了一些重复的作业(作业计划本身),这意味着作业表无法
  2. 使用IAM用户使用表表可以空置为RDS (没关系dev_ro或dev_rw)
  3. 在我的IDE(dbeaver-没关系,我认为)
  4. 运行select * select * from graphile_worker.jobs 使用Superuser凭据(创建服务器时创建的)
  5. 运行与上面的查询相同
  6. ,请参见表中的数据,

我不知道为什么会发生这种情况。 我仔细检查了“ Dev_ro/W”(通过角色)和Superuser,都具有:

  • 连接到数据库(毫无疑问)
  • 在所有的表上选择 select graphile_worker 架构
  • 用法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:

  1. myschema is "public" - which is my default schema
  2. 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:

  1. I run my application which adds some repeating jobs (jobs schedule itself), implying that the jobs table can never be empty
  2. Connect to RDS using the IAM user (doesn't matter dev_ro or dev_rw)
  3. I run SELECT * FROM graphile_worker.jobs in my IDE (dbeaver - shouldn't matter, I think)
  4. The table shows up empty
  5. Disconnect and Re-connect to RDS using superuser credentials (which are created when server is created)
  6. Run same query as above
  7. 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 of graphile_worker schema
  • USAGE on the graphile_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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一梦浮鱼 2025-01-30 07:59:26

删除行级安全性(RLS)解决了此问题。
感谢@hambone提出正确的问题。

通过执行删除RLS

ALTER ROLE <username> WITH BYPASSRLS

Removing Row-Level Security (RLS) solved this issue.
Thanks @Hambone for asking the right question.

RLS is removed by executing

ALTER ROLE <username> WITH BYPASSRLS
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文