I was reading about network compression with PostgreSQL to see if there was anything that offered that which would permit big result sets to transfer over the wire to remote web servers. It seems there is nothing of this sort. Is there a solution out there to do that, that isn't SSL?


It seems at one point there was a solution involving SSL. Having read the threads pertaining to that, it seems that the solution is no longer advisable as it leaves the system vulnerable to a CRIME worldwide bug.

Though not advisable, it seems that you can re-enable SSL Compression at least currently with OPENSSL_DEFAULT_ZLIB but that it will be removed in the future and that it's currently disabled at compiled time in openssl.

no-zlib         [default]
no-zlib-dynamic [default]

2 Answers 2


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.



There is a patch in the works that will provide compression with LibPQ you can find it here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.