use pg_qsort