Postgresql Find Duplicate Values In Relationships