PostgreSQL network compression for result set?
This part of the documentation describes how you can do it by first setting up an SSH tunnel (outside of Postgres) and then connecting to that. If you add the -C flag to the ssh command, it should enable compression.

https://www.postgresql.org/docs/current/static/ssh-tunnels.html