A problem about LEAKPROOF of postgresql

From: "qiumingcheng" <qiumingcheng(at)aliyun(dot)com>
To: "pgsql-bugs" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Cc: "qiumingcheng" <qiumingcheng(at)huawei(dot)com>
Subject: A problem about LEAKPROOF of postgresql
Date: 2022-09-08 05:04:25
Message-ID: 9f1ec18e-23fb-47fe-b83a-7b996aaddc2e.qiumingcheng@aliyun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

你好,专家,请教个关于postgresql(代码所在分支:master,代码所在文件:selfuncs.c)源码的问题,代码如下。按照我的理解,在优化器阶段,下方红线框中的代码是可以去掉的,否则可能会影响影视图响执行计划路径选择:
一个用户A创建了视图,并将该视图授权给他用户B(B用户只有视图权限,没有该视图对应的表权限),那么在A用户下查询这个视图,可以看到执行计划路径会选择索引路径,但是在B用户实行该视图,他不会选择索引路径,我知道这
是一个关于LEAKPROOF的问题,我的参考链接如下:
https://www.2ndquadrant.com/en/blog/how-do-postgresql-security_barrier-views-work/ <https://www.2ndquadrant.com/en/blog/how-do-postgresql-security_barrier-views-work/ >
请帮忙解答一下:在优化器阶段,这段代码没啥不能去掉?或者说,如果我去掉下方红线框中的代码会带来啥问题。
另外,我

Browse pgsql-bugs by date

  From Date Subject
Next Message qiumingcheng 2022-09-08 05:12:03 A problem about LEAKPROOF of postgresql
Previous Message Ming 2022-09-08 02:02:51 Postgres offset and limit bug