© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
2 replies
felsey

Debug RLS

I have RLS turned on for a table I'm not able to insert a row because it's violating RLS for that table.

From what I can tell everything should be working as expected.

The policy check is
(auth.uid() = creator_profile_id)
(auth.uid() = creator_profile_id)
and this is the code to create insert a row.

    const { data, error: listError } = await supabase
      .from("lists")
      .insert([
        {
          creator_profile_id: user.id,
          name: listName,
          google_place_id: selectedPlace.placeId,
          google_place_name: selectedPlace.description,
          google_place_types: JSON.stringify(selectedPlace.types),
          photo_url: await getPhoto(selectedPlace?.description),
        },
      ])
      .select("*");
    const { data, error: listError } = await supabase
      .from("lists")
      .insert([
        {
          creator_profile_id: user.id,
          name: listName,
          google_place_id: selectedPlace.placeId,
          google_place_name: selectedPlace.description,
          google_place_types: JSON.stringify(selectedPlace.types),
          photo_url: await getPhoto(selectedPlace?.description),
        },
      ])
      .select("*");


What's the best way to debug this and figure out why it's saying that
new row violates row-level security policy for table \"lists\"
new row violates row-level security policy for table \"lists\"
Screenshot_2022-11-04_at_3.48.04_PM.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

RLS policy blocking Insert from Debug
SupabaseSSupabase / help-and-questions
5mo ago
What's the best way to debug any RLS policy?
SupabaseSSupabase / help-and-questions
4y ago
rls
SupabaseSSupabase / help-and-questions
4y ago
RLS
SupabaseSSupabase / help-and-questions
4y ago