Postgresql - 运行 子查询不显示用户的结果

Postgresql - running subquery doesn't show results for an user

我在数据库中有这个用户,这个用户只需要读取权限,这里是现在拥有的权限:

GRANT USAGE ON SCHEMA myschema TO "user";
GRANT SELECT ON TABLES TO "user";
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA myschema to "user";

如果运行此查询没有显示结果,但如果我使用管理员用户显示结果:

SELECT "tableA"."tableA_id", "tableA"."first_name", "tableA"."last_name", "brands"."brand_id" AS "brands.brand_id",
"brands->tableB"."door_id" AS "brands.tableB.door_id", "brands->tableB"."agent_id" AS "brands.tableB.agent_id",
"brands->tableB"."tableA_id" AS "brands.tableB.tableA_id", "brands->tableB"."brand_id" AS "brands.tableB.brand_id",
"brands->tableB"."relationship_type" AS "brands.tableB.relationship_type", "agents"."agent_id" AS "agents.agent_id", 
"agents"."relationship_type" AS "agents.relationship_type" 
FROM "myschema"."tableA" AS "tableA" 
INNER JOIN ( "myschema"."tableB" AS "brands->tableB" INNER JOIN "myschema"."brand" AS "brands" ON "brands"."brand_id" = "brands->tableB"."brand_id") ON "tableA"."tableA_id" = "brands->tableB"."tableA_id" AND "brands"."brand_id" = 1 
INNER JOIN "myschema"."tableB" AS "agents" ON "tableA"."tableA_id" = "agents"."tableA_id" AND "agents"."relationship_type" = 'Employee' 
WHERE "tableA"."active" = true ORDER BY "tableA"."first_name" ASC;

知道检查此数据需要哪些权限吗?

此致

缺少权限不会影响查询结果,它们会导致“权限被拒绝”错误。我知道的例外是

  • information_schema 视图的查询,仅显示您对其具有权限的对象

  • row-level 安全性

如果有的话,您的问题表明 row-level 安全性在这里发挥作用。

如果您需要更详细的答案,您必须在问题中添加详细信息。