Quantcast
Viewing all articles
Browse latest Browse all 60

How to enforce entity existence across N-tables - postgres

Let's say we decided to split user table in two, one will have data related to authentication, another basic user description:

   user_tableuser_id | name1       | Max2       | Alex3       | Should not be possible
   auth_tableuser_id | email   | password1       | m@m.com | 1232       | a@a.com | 3214       | s@s.com | Should not be possible

Is it possible to enforce existence of the same user_id? Basically both tables should have exactly same number of rows and each row should have a match in both tables.


Viewing all articles
Browse latest Browse all 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>