© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
5 replies
iolyd

Constraining select based on update RLS

Say I have
table_a
table_a
with a
select
select
rls open to everyone, but on an editor page of my app I want to check if the user actually fulfills the necessary
update
update
rls (that is more constraining) before fetching the data. I can see many ways of doing this:
- moving the
update
update
rls logic into a procedure that I can then separately call from my app's server to check before doing a select
- manually keeping my app's
select
select
query's filter up to date with the
update
update
rls
- ?? doing an empty
update
update
with a
select
select
modifier

Is the last one a bad practice? Is there some other way of asking pg/sql to use the
update
update
rls for a specific
select
select
query without having to replicate the policie's logic?
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 based on custom jwt
SupabaseSSupabase / help-and-questions
4y ago
RLS - Restrict based on a token
SupabaseSSupabase / help-and-questions
4y ago
No RLS error on update
SupabaseSSupabase / help-and-questions
13mo ago
SELECT based on auth.uid()
SupabaseSSupabase / help-and-questions
4y ago