「libpq.dllが見つかりません」と言われたのでこちらで公開されているのを入れたら動きましたhttp://www.emaki.minidns.net/Programming/postgres/index.html