Set sslmode=allow with pg_dump

qwertzguy picture qwertzguy · Apr 24, 2017 · Viewed 8k times · Source

I need to specify sslmode=allow when using psql to connect to my PostgreSQL DB, like: psql sslmode=allow -h localhost -p 5432 otherwise I get server does not support SSL, but SSL was required

I tried specifying the same option to pg_dump but it doesn't recognize the option.

How do I specify sslmode to pg_dump?

Answer

qwertzguy picture qwertzguy · Apr 24, 2017

You need to use the environment variable PGSSLMODE like this:

PGSSLMODE=allow pg_dump -h localhost -p 5432