updating code to use latest version of postgres-copy