Postgresql – pg_dump with ssl certificates

backuppg-dumppostgresqlpostgresql-9.1

I would like to run the pg_dump command from a remote host off my database server that only allows fully verified certificate based connections. How should I go about doing this? The man pages for 9.1 state the instructions for connecting via password from what I could see.

Best Answer

The following worked for me:

pg_dump "port=<port> host=<host> user=<user> dbname=<db> sslcert=<cert> sslkey=<key> sslrootcert=<ca.crt> sslmode=verify-ca" -f <file>