Re: Postgres 12 RLS

2020-06-08 Thread Laura Smith
On Monday, 8 June 2020 12:42, Paul Förster wrote: > Hi Laura, > > > On 08. Jun, 2020, at 12:46, Laura Smith n5d9xq3ti233xiyif...@protonmail.ch > > I had a lightbulb moment just now and tried that, but it doesn't seem to be > > working. > > The app returns "pg_execute(): Query failed: ERROR: p

Re: Postgres 12 RLS

2020-06-08 Thread Paul Förster
Hi Laura, > On 08. Jun, 2020, at 12:46, Laura Smith > I had a lightbulb moment just now and tried that, but it doesn't seem to be > working. > > The app returns "pg_execute(): Query failed: ERROR: permission denied for > table" > > This is despite me: > • Changing to SECURITY INVOKER on

Re: Postgres 12 RLS

2020-06-08 Thread Laura Smith
On Monday, 8 June 2020 11:25, Paul Förster wrote: > Hi Laura, > > > On 08. Jun, 2020, at 12:17, Laura Smith n5d9xq3ti233xiyif...@protonmail.ch > > $$ LANGUAGE plpgsql SECURITY DEFINER; > > you might want to use security invoker instead of definer. > > https://www.postgresql.org/docs/current/sq

Re: Postgres 12 RLS

2020-06-08 Thread Paul Förster
Hi Laura, > On 08. Jun, 2020, at 12:17, Laura Smith > $$ LANGUAGE plpgsql SECURITY DEFINER; you might want to use security invoker instead of definer. https://www.postgresql.org/docs/current/sql-createfunction.html#SQL-CREATEFUNCTION-SECURITY https://www.cybertec-postgresql.com/en/abusing-sec