© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
4 replies
FauxLion

How can I ensure that user id are unique even after deletion ?

I want to share user id with third party services like revenuecat, however in my app i allow user to remove account then the uid could be assigned to another user (very unlikely as the risk of collision is very low) but i have to handle this case.

My idea is to create a table with shared_uid and user_id columns.
Each time a user is inserted a new row will be inserted in the table.
When the user_id is removed , i set it to null then the shared_uid will remain in the table.

As well it adds an extra layer of anonymization like other services will not know the internal user IDs.

Do you think it's a good idea ? Or overengineering maybe ?
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

[resolved] Is the authentication user id unique?
SupabaseSSupabase / help-and-questions
4y ago
Recreating a user after manual deletion doesn't work
SupabaseSSupabase / help-and-questions
2mo ago
Re-create account after deletion
SupabaseSSupabase / help-and-questions
4mo ago
How can I fetch data on a user that I get from a query
SupabaseSSupabase / help-and-questions
4y ago