Upsert not working with Row Level Security
I am trying to setup an upsert for authenticated users. I have setup two row level policies, one is the insert for authenticated users only, the other is an update for authenticated users only. Couldn't get the update for authenticated users only to work, so testing out RLS for anonymous users as well, and I'm still getting the error
when performing the update. Performing the insert works ok, but the update gives me the error.
My code is
The RLS for Update is attached

4 Replies
You also need to meet the select policy.
You say authenticate user but your policy has anon as the role which will only work for anon.
You say authenticate user but your policy has anon as the role which will only work for anon.
yes I set it at as anon just to test if it works w anon, it doesn't
also, if I do a regular update on this table, it works just fine with the anon policy
only with the update of upsert does it fail
All 3 policies (select, update,insert) have to be the same role.
oh
ill try again with authenticated then