Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 755F2C3830A for ; Thu, 14 Jun 2012 02:19:46 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sf2T9-0001BM-V9 for pgsql-hackers@postgresql.org; Thu, 14 Jun 2012 05:19:45 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q5E5JUZJ029854; Thu, 14 Jun 2012 01:19:30 -0400 (EDT) From: Tom Lane To: Euler Taveira cc: Pgsql Hackers Subject: Re: libpq compression In-reply-to: <4FD9698F.2090407@timbira.com> References: <4FD9698F.2090407@timbira.com> Comments: In-reply-to Euler Taveira message dated "Thu, 14 Jun 2012 01:33:19 -0300" Date: Thu, 14 Jun 2012 01:19:30 -0400 Message-ID: <29853.1339651170@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/619 X-Sequence-Number: 209459 Euler Taveira writes: > There was already some discussion about compressing libpq data [1][2][3]. > Recently, I faced a scenario that would become less problematic if we have had > compression support. The scenario is frequent data load (aka COPY) over > slow/unstable links. It should be executed in a few hundreds of PostgreSQL > servers all over Brazil. Someone could argue that I could use ssh tunnel to > solve the problem but (i) it is complex because it involves a different port > in the firewall and (ii) it's an opportunity to improve other scenarios like > reducing bandwidth consumption during replication or normal operation over > slow/unstable links. I still think that pushing this off to openssl (not an ssh tunnel, but the underlying transport library) would be an adequate solution. If you are shoving data over a connection that is long enough to need compression, the odds that every bit of it is trustworthy seem pretty small, so you need encryption too. We do need the ability to tell openssl to use compression. We don't need to implement it ourselves, nor to bring a bunch of new library dependencies into our builds. I especially think that importing bzip2 is a pretty bad idea --- it's not only a new dependency, but bzip2's compression versus speed tradeoff is entirely inappropriate for this use-case. regards, tom lane