Re: when is RLS policy applied

Поиск
Список
Период
Сортировка
От Ted Toth
Тема Re: when is RLS policy applied
Дата
Msg-id CAFPpqQFSfCjmx3TYjjDTECUgpeDkuPFQQO8Qe+s9TMdOjzV3gg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: when is RLS policy applied  (Ted Toth <txtoth@gmail.com>)
Ответы Re: when is RLS policy applied  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: when is RLS policy applied  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I've looked for information on leakproofness of operators but haven't found anything can you direct me to a source of this information?

On Fri, Jul 24, 2020 at 3:40 PM Ted Toth <txtoth@gmail.com> wrote:

On Fri, Jul 24, 2020 at 3:15 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Ted Toth <txtoth@gmail.com> writes:
> I'm trying to understand when RLS select policy is applied so I created the
> follow to test but I don't understand why the query filter order is
> different for the 2 queries can anyone explain?

The core reason why not is that the ~~ operator isn't considered
leakproof.  Plain text equality is leakproof, so it's safe to evaluate
ahead of the RLS filter --- and we'd rather do so because the plpgsql
function is assumed to be much more expensive than a built-in operator.

(~~ isn't leakproof because it can throw errors that expose information
about the pattern argument.)

                        regards, tom lane

Thanks for the explanation. 

Ted 

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Row estimates for empty tables
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: when is RLS policy applied