I don't know about the coding changes required, however, this is probably as good a place as any to point out that pg_dump will take up a lot of RAM when dumping data (which you will then import into your new database).
I have found that at least under OpenBSD, and I am sure some other OSes as well, the default limits on max data size, etc. can cause pg_dump to be killed off by the kernel.
To fix: look at current limits with "ulimit -a" , increase data size limits with ulimit -d {number of kbytes}, then re-run pg_dump.
For my tables, I find that pg_dump needs about 95 to 100MB to successfully dump.