© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
19 replies
ismael1234

Query foreign tables between a post and a user

I have a posts table connected to the user who created it through uuid. How can I select posts and also get user information?

I have something like this:
const test = await subase.from("posts").select(

     *,
     users(
       username
     )
     

     *,
     users(
       username
     )
     
);

but it always returns the message "Could not find a relationship between 'posts' and 'users' in the schema cache".
How can I retrieve user data from posts table?
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

Issue to query foreign tables
SupabaseSSupabase / help-and-questions
4y ago
Querying foreign tables w SDK
SupabaseSSupabase / help-and-questions
4y ago
Relationship between tables
SupabaseSSupabase / help-and-questions
4y ago
Row level security and sorting on foreign tables
SupabaseSSupabase / help-and-questions
4y ago