С postgres 9.0+ можете да пишете: select string_agg(product,' | ' order by product) from "tblproducts" Подробности тук.