How to create a compressed backup of postgresql database on remote host ?

simply use this command on terminal:

PGPASSWORD=”pass” pg_dump -U username -h hostaddress  dbname | gzip > dbname.gz

Advertisements