Harvest parts

Fix the Postgres SELECT DISTINCT/ORDER BY problem with #337.