crossposing from <#843999948717555735> here since ...
# sql
a
crossposing from #843999948717555735 here since it might fit better; I'm trying to make a RLS policy where anyone can get rows from a table but only specific information is returned, here's what i have so far but its giving me a syntax error:
Copy code
sql
CREATE POLICY "Public profiles with minimal data"
ON public.profiles
FOR SELECT USING (
  SELECT id, preferred_name, identity_data - 'email' identity_data, access FROM public.profiles 
);
b
oops, forgot to create the thread
i'm not sure if policies are supposed to be used for this. u can select specific columns with the api or create a view
a
yeah I ended up just using the server side for it
k
RLS policies can only restrict access to rows. Ordinary permissions can restrict access to columns. For anything inbetween you'll need a custom function.