Postgresql Check If Value Exists In Another Table