I'm using PostgreSQL and new to databases in general.
Say I have a table of users, and I want to let users define that they are another user's wife/husband/whatever they want. Assume that a user can say another user is their grandma, and that user can say the other user is their "grandson in Maine" (i.e. it is directed).
Do I create a table for users, and another table that looks something like:
CREATE TABLE user_relationships (
user0 INT REFERENCES app_user(id),
user1 INT REFERENCES app_user(id),
relationship VARCHAR(100)
);
to hold all of the relationships separately, or is there a better way to link both the other user and the defined relationship in the user table?