Postgresql Sql Substring Before Specific Character