Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-06-30 Thread Amit Langote
On Wed, Jun 28, 2023 at 4:30 PM Amit Langote wrote: > > Hi, > > On Tue, Feb 21, 2023 at 4:12 PM Amit Langote wrote: > > On Tue, Feb 21, 2023 at 12:40 AM Tom Lane wrote: > > > Alvaro Herrera writes: > > > > On 2023-Feb-20, Amit Langote wrote: > > > >> One more thing we could try is come up with

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-06-28 Thread Amit Langote
Hi, On Tue, Feb 21, 2023 at 4:12 PM Amit Langote wrote: > On Tue, Feb 21, 2023 at 12:40 AM Tom Lane wrote: > > Alvaro Herrera writes: > > > On 2023-Feb-20, Amit Langote wrote: > > >> One more thing we could try is come up with a postgres_fdw test case, > > >> because it uses the

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-02-20 Thread Amit Langote
On Tue, Feb 21, 2023 at 12:40 AM Tom Lane wrote: > Alvaro Herrera writes: > > On 2023-Feb-20, Amit Langote wrote: > >> One more thing we could try is come up with a postgres_fdw test case, > >> because it uses the RelOptInfo.userid value for remote-costs-based > >> path size estimation. But

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-02-20 Thread Tom Lane
Alvaro Herrera writes: > On 2023-Feb-20, Amit Langote wrote: >> One more thing we could try is come up with a postgres_fdw test case, >> because it uses the RelOptInfo.userid value for remote-costs-based >> path size estimation. But adding a test case to contrib module's >> suite test a core

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-02-20 Thread Alvaro Herrera
On 2023-Feb-20, Amit Langote wrote: > On Fri, Feb 17, 2023 at 9:02 PM Alvaro Herrera > wrote: > > I tried a few things for a new test case, but I was unable to find > > anything useful. Maybe an intermediate view, I thought; no dice. > > Maybe one with a security barrier would do? Anyway,

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-02-19 Thread Amit Langote
On Fri, Feb 17, 2023 at 9:02 PM Alvaro Herrera wrote: > On 2022-Dec-11, Amit Langote wrote: > > While staring at the build_simple_rel() bit mentioned above, I > > realized that this code fails to set userid correctly in the > > inheritance parent rels that are child relations of subquery parent >

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-02-17 Thread Alvaro Herrera
On 2023-Feb-17, Alvaro Herrera wrote: > I tried a few things for a new test case, but I was unable to find > anything useful. Maybe an intermediate view, I thought; no dice. > Maybe one with a security barrier would do? Anyway, for now I just kept > what you added in v2. Sorry, I failed to

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-02-17 Thread Alvaro Herrera
On 2022-Dec-11, Amit Langote wrote: > While staring at the build_simple_rel() bit mentioned above, I > realized that this code fails to set userid correctly in the > inheritance parent rels that are child relations of subquery parent > relations, such as UNION ALL subqueries. In that case,

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-01-19 Thread Alvaro Herrera
On 2023-Jan-19, Amit Langote wrote: > It seems that, with the test as written, it's not the partitioned > table referenced in the view's query that becomes a child of the UNION > ALL parent subquery, but the subquery itself. The bug being fixed in > 0002 doesn't affect the planning of this query

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-01-19 Thread Amit Langote
On Tue, Jan 17, 2023 at 7:33 PM Alvaro Herrera wrote: > On 2022-Dec-12, Amit Langote wrote: > > On Sun, Dec 11, 2022 at 6:25 PM Amit Langote > > wrote: > > > I've attached 0001 to remove those extraneous code blocks and add a > > > comment mentioning that userid need not be recomputed. > > > >

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-01-17 Thread Alvaro Herrera
On 2022-Dec-12, Amit Langote wrote: > On Sun, Dec 11, 2022 at 6:25 PM Amit Langote wrote: > > I've attached 0001 to remove those extraneous code blocks and add a > > comment mentioning that userid need not be recomputed. > > > > While staring at the build_simple_rel() bit mentioned above, I > >

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-01-05 Thread Tom Lane
Justin Pryzby writes: > On Wed, Dec 21, 2022 at 01:44:11PM -0600, Justin Pryzby wrote: >> Alvaro could you comment on this ? I believe Alvaro's on vacation for a few days more. regards, tom lane

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2023-01-05 Thread Justin Pryzby
On Wed, Dec 21, 2022 at 01:44:11PM -0600, Justin Pryzby wrote: > Alvaro could you comment on this ? I added here so it's not forgotten. https://commitfest.postgresql.org/42/4107/

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2022-12-21 Thread Justin Pryzby
Alvaro could you comment on this ?

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2022-12-11 Thread Amit Langote
On Sun, Dec 11, 2022 at 6:25 PM Amit Langote wrote: > I've attached 0001 to remove those extraneous code blocks and add a > comment mentioning that userid need not be recomputed. > > While staring at the build_simple_rel() bit mentioned above, I > realized that this code fails to set userid

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2022-12-11 Thread Justin Pryzby
On Sun, Dec 11, 2022 at 06:25:48PM +0900, Amit Langote wrote: > On Sun, Dec 11, 2022 at 5:17 AM Justin Pryzby wrote: > > The original code rechecks rte->checkAsUser with the rte of the parent > > rel. The patch changed to access onerel instead, but that's not updated > > after looping to find

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2022-12-11 Thread Amit Langote
Hi, On Sun, Dec 11, 2022 at 5:17 AM Justin Pryzby wrote: > On Tue, Nov 29, 2022 at 10:37:56PM +0900, Amit Langote wrote: > > 0002 contains changes that has to do with changing how we access > > checkAsUser in some foreign table planning/execution code sites. > > Thought it might be better to

Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)

2022-12-10 Thread Justin Pryzby
On Tue, Nov 29, 2022 at 10:37:56PM +0900, Amit Langote wrote: > 0002 contains changes that has to do with changing how we access > checkAsUser in some foreign table planning/execution code sites. > Thought it might be better to describe it separately too. This was committed as 599b33b94: Stop