While reviewing patch [1], I raised a comment about cast-away-const in pg_dump_sort.c. However, the comment was not accepted and the argument was that the nearby code did the same thing.
I saw Tom recently had a commit [2] that removed some cast-away-const in ecpg, so I am filing this patch to eliminate all cast-away-const problems in pg_dump_sort.c.