Redirect pg_dump output to stdout How to redirect pg_dump -Fd output to gzip? It requires that a directory would be specified.
PGPASSWORD=$db_pass pg_dump mydb -U db_user -h localhost --verbose 2&gt;/var/log/postgresql/pgdump.log -Fd | gzip &gt; /mnt/bulk-data/db_backup/mydb_bak.gz
You cannot do that. Use one of the other formats; ideally the custom format, which is automatically compressed.