pg SELECT DISTINCT fixed