"SELECT u.* FROM user u, address a WHERE a.city='New York' and a.user_name=u.user_name
In Postgres the relationship between users and addresses can be explicity defined. Once defined the address becomes a property of the user, so the search above can be simplified greatly to:
SELECT * FROM user WHERE address.city='New York'"
Is the a load of nonsense, or am I doing something wrong? I did define a foreign key, but it doesn't work.
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend