Reorder headers for use in pgsql