Concerning rebuilding the PG driver: you have most likely a 64 bit postgres installation on the new machine. If you want to link to a 32 bit binary, you have to build the pg driver as well with 32 bit (fiddle with compile-flags) and you will need therefore to install as well the 32bit pg libraries. Accessing a 64bit compiled PG database from 32bit PG driver works well (and vice versa).