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

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)
Дата
Msg-id 20221211142158.GC27893@telsasoft.com
обсуждение исходный текст
Ответ на Re: ExecRTCheckPerms() and many prunable partitions (checkAsUser)  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers
On Sun, Dec 11, 2022 at 06:25:48PM +0900, Amit Langote wrote:
> On Sun, Dec 11, 2022 at 5:17 AM Justin Pryzby <pryzby@telsasoft.com> 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 the parent.
> >
> > Is that okay ?  It doesn't seem intentional, since "userid" is still
> > being recomputed, but based on onerel, which hasn't changed.  The
> > original intent (since 553d2ec27) is to recheck the parent's
> > "checkAsUser".
> >
> > It seems like this would matter for partitioned tables, when the
> > partition isn't readable, but its parent is, and accessed via a view
> > owned by another user?
> 
> Thanks for pointing this out.
> 
> I think these blocks which are rewriting userid to basically the same
> value should have been removed from these sites as part of 599b33b94.

I thought maybe; thanks for checking.

Little nitpicks:

001:
Fine to use the same userid as it's same in all
=> the same

002:
give that it's a subquery rel.
=> given

-- 
Justin



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "houzj.fnst@fujitsu.com"
Дата:
Сообщение: RE: Perform streaming logical transactions by background workers and parallel apply
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Error-safe user functions