Re: when is RLS policy applied

2020-07-24 Thread Adrian Klaver
On 7/24/20 2:15 PM, Adrian Klaver wrote: On 7/24/20 2:12 PM, Ted Toth wrote: I've looked for information on leakproofness of operators but haven't found anything can you direct me to a source of this information? See here: https://www.postgresql.org/docs/12/catalog-pg-proc.html "proleakproof

Re: when is RLS policy applied

2020-07-24 Thread Tom Lane
Ted Toth writes: > I've looked for information on leakproofness of operators but haven't found > anything can you direct me to a source of this information? Operators per se don't have a leakproofness attribute; the function underlying the operator is what has that property.

Re: when is RLS policy applied

2020-07-24 Thread Adrian Klaver
On 7/24/20 2:12 PM, Ted Toth wrote: I've looked for information on leakproofness of operators but haven't found anything can you direct me to a source of this information? See here: https://www.postgresql.org/docs/12/catalog-pg-proc.html "proleakproof bool The function has no side effect

Re: when is RLS policy applied

2020-07-24 Thread Ted Toth
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 wrote: > > On Fri, Jul 24, 2020 at 3:15 PM Tom Lane wrote: > >> Ted Toth writes: >> > I'm trying to understand when R

Re: when is RLS policy applied

2020-07-24 Thread Ted Toth
On Fri, Jul 24, 2020 at 3:15 PM Tom Lane wrote: > Ted Toth 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

Re: when is RLS policy applied

2020-07-24 Thread Tom Lane
Ted Toth 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

Re: when is RLS policy applied

2020-07-24 Thread Adrian Klaver
On 7/24/20 12:34 PM, Ted Toth wrote: 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 way I see it is: 1) First case. The service column is the on

when is RLS policy applied

2020-07-24 Thread Ted Toth
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? CREATE USER bob NOSUPERUSER; CREATE TABLE t_service (service_type text, service text); INSERT INTO t_servi