© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
2 replies
Fayyaz

Issue querying multi-level/relational tables

I have an issue querying the tables.

I have three tables
1->profile (auth.id (FK from auth.user table), username, useremail)
2->posts (post_id, user_id (FK from profile table, post_text))
3->post_replies(reply_id, user_id (FK from profile table), post_id (FK from posts table), reply_text)


Query below works fine if there is no relationship between "posts" and the "post_replies" tables.

const { data: posts } = awaitsupabase.from('posts').select('* ,profile(username, useremail)

as soon as I add the relationship (posts->post_replies), it starts returning "null" value,

I have tried disabling RLS but no luck, as soon as I remove the relation it start returing the data.
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

Querying Joins and Nested tables issue
SupabaseSSupabase / help-and-questions
3mo ago
Querying different schema tables
SupabaseSSupabase / help-and-questions
13mo ago
Querying foreign tables w SDK
SupabaseSSupabase / help-and-questions
4y ago
error while Querying foreign tables - JS
SupabaseSSupabase / help-and-questions
4y ago