© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
12 replies
Абрамян_Игорь_1607835551

Can't access a table using RLS.

Hi! I created two RLS policies: INSERT for authenticated users only and the same for SELECT (check screenshots).

Then I try to INSERT a new row into this table and get this error: postgrest.exceptions.APIError: {'code': '42501', 'details': None, 'hint': None, 'message': 'new row violates row-level security policy for table "kisis_forms"'}

I use these docs for Supabase Py: https://github.com/supabase-community/supabase-py

So initially I create a client:
from supabase import create_client, Client
supabase: Client = create_client(url, key)

#Afterwards I do the auth:
email: str = str(user_mail)
password: str = str(user_pass)
supabase.auth.sign_in(email=email, password=password)

#Then I try to INSERT a new row and recieve mentioned error:
data = supabase.table(table_name).insert({"tg_id": user_id, "name": name}).execute()
from supabase import create_client, Client
supabase: Client = create_client(url, key)

#Afterwards I do the auth:
email: str = str(user_mail)
password: str = str(user_pass)
supabase.auth.sign_in(email=email, password=password)

#Then I try to INSERT a new row and recieve mentioned error:
data = supabase.table(table_name).insert({"tg_id": user_id, "name": name}).execute()


Guys, could you please help me to resolve this?
unknown.png
GitHub
GitHub - supabase-community/supabase-py: Python Client for Supabase
Python Client for Supabase. Contribute to supabase-community/supabase-py development by creating an account on GitHub.
GitHub - supabase-community/supabase-py: Python Client for Supabase
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

RLS with a join table
SupabaseSSupabase / help-and-questions
4y ago
RLS Policy on a link table
SupabaseSSupabase / help-and-questions
4y ago
RLS on related table
SupabaseSSupabase / help-and-questions
8mo ago
RLS With Join Table
SupabaseSSupabase / help-and-questions
4y ago