Re: ExecRTCheckPerms() and many prunable partitions
Amit Langote <amitlangote09@gmail.com>
From: Amit Langote <amitlangote09@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Ian Lawrence Barwick <barwick@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, David Rowley <dgrowleyml@gmail.com>, Greg Stark <stark@mit.edu>, Julien Rouhaud <rjuju123@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-02T11:13:28Z
Lists: pgsql-hackers
Attachments
- v32-0001-Rework-query-relation-permission-checking.patch (application/octet-stream) patch v32-0001
On Fri, Dec 2, 2022 at 7:00 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote: > On 2022-Dec-02, Amit Langote wrote: > > This sounds like a better idea than adding a new AttrMap, so done this > > way in the attached 0001. > > Thanks for doing that! I have pushed it, but I renamed > ri_RootToPartitionMap to ri_RootToChildMap and moved it to another spot > in ResultRelInfo, which allows to simplify the comments. Thanks. > > I've also merged into 0002 the delta patch I had posted earlier to add > > a copy of RTEPermInfos into the flattened permInfos list instead of > > adding the Query's copy. > > Great. At this point I have no other comments, except that in both > parse_relation.c and rewriteManip.c you've chosen to add the new > functions at the bottom of each file, which is seldom a good choice. > I think in the case of CombineRangeTables it should be the very first > function in the file, before all the walker-type stuff; and for > Add/GetRTEPermissionInfo I would suggest that right below > addRangeTableEntryForENR might be a decent choice (need to fix the .h > files to match, of course.) Okay, I've moved the functions and their .h declarations to the places you suggest. While at it, I also uncapitalized Add/Get, because that's how the nearby functions in the header are named. Thanks again for the review. The patch looks much better than it did 3 weeks ago. -- Thanks, Amit Langote EDB: http://www.enterprisedb.com
Commits
-
Add a test case for a316a3bc
- 054ff3b33a85 17.0 landed
- 0a14bca662a4 16.0 landed
-
Correctly set userid of subquery relations' child rels
- a316a3bc6d3f 16.0 landed
-
Fix buggy recursion in flatten_rtes_walker().
- c7468c73f7b6 16.0 landed
-
Remove some dead code in selfuncs.c
- 438e6b724090 16.0 landed
-
Update outdated comment in ApplyRetrieveRule
- 29861e228a47 16.0 landed
-
Rework query relation permission checking
- a61b1f74823c 16.0 landed
-
Generalize ri_RootToPartitionMap to use for non-partition children
- fb958b5da86d 16.0 landed
-
Stop accessing checkAsUser via RTE in some cases
- 599b33b9492d 16.0 landed
-
Add 'missing_ok' argument to build_attrmap_by_name
- ad86d159b6ab 16.0 landed