© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
17 replies
bunge

multiple foreign keys in one table

Is it possible if I have a loads table that consists of Carriers and Customers with ID’s in the Accounts table to have foreign keys for both of these fields in the loads table pointing to the one Accounts ID field?
Example:
Loads table:
Carrier : UUID
Customer: UUID

Accounts Table:
ID : UUID
account_type: carrier or customer

Doing this I have gotten a foreign key error before and am not sure how to fix.
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

array of foreign keys
SupabaseSSupabase / help-and-questions
4y ago
Query table with multiple cols with same foreign key. Join tables.
SupabaseSSupabase / help-and-questions
3y ago
linking multiple foreign key to a single one
SupabaseSSupabase / help-and-questions
3y ago
Show entry only if at least one entry in foreign table One-to-Many relation
SupabaseSSupabase / help-and-questions
3y ago