Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 22CFF1337B54 for ; Sun, 17 Apr 2011 21:26:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 30944-06 for ; Mon, 18 Apr 2011 00:26:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iy0-f174.google.com (mail-iy0-f174.google.com [209.85.210.174]) by mail.postgresql.org (Postfix) with ESMTP id 92E001337B49 for ; Sun, 17 Apr 2011 21:26:02 -0300 (ADT) Received: by iyb14 with SMTP id 14so3481256iyb.19 for ; Sun, 17 Apr 2011 17:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=UPhNXdTeKA4OjJfjz0o34Seul7bPZkg1wX9T0PcFoyU=; b=MgFo5CtlmDkySeIlK2Fi3+l9m6MNkdPTqIkstlXY411U0Gi9ixT6og7VFxmxJMY1eT 1HySLvLFEXi+qXdw31XDOYt/eiX1q78WbRB9pXTVqV44MdOKfupad1kTsSyLJBm1bp0Z YkhNQyRtluuiCsOrALHXJqjJrLw1F8erw1qTE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=FaZm88uxJ4PSnvYDmFeQDkNtu3arI0VYa2SXlHzGHEpaIMUk8kXIjtKIrAOE0HCqC8 hF/6eb88iqx7X5Cp0GuhlBJEykbyd8pZK/2dN9o9N4/HKhWffU66i5KaWmg5G47N48BF XR0E6pmTN29eNFBDtrHgqjQ5tS4HWXJ2cVMnA= MIME-Version: 1.0 Received: by 10.231.8.67 with SMTP id g3mr3336003ibg.115.1303086362420; Sun, 17 Apr 2011 17:26:02 -0700 (PDT) Received: by 10.231.31.205 with HTTP; Sun, 17 Apr 2011 17:26:02 -0700 (PDT) Date: Mon, 18 Apr 2011 02:26:02 +0200 Message-ID: Subject: Default compression level for custom format in pg_dump ? From: Grzegorz Szpetkowski To: pgsql-docs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.888 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201104/79 X-Sequence-Number: 6650 Hi, I can't find in documentation what is implicit default compression level for pg_dump format. There (http://www.postgresql.org/docs/9.0/static/app-pgdump.html) is only: "This format is also compressed by default." "For the custom archive format, this specifies compression of individual table-data segments, and the default is to compress at a moderate level." After some some reaserching I found it actually depends on zlib library behaviour. In other words pg_dump is "zlib aware" and actually it is 6 and it's constant value: pg_dump someDB -Fc -f dump pg_dump someDB -Fc -Z-1 dump (I know that -1 is not "legal", but it works) pg_dump someDB -Fc -Z6 -f dump In pg_dump.c there is (main function): int compressLevel = -1; ... else if (pg_strcasecmp(format, "c") == 0 || pg_strcasecmp(format, "custom") == 0) g_fout = CreateArchive(filename, archCustom, compressLevel, archModeWrite); Then "it goes to" zlib library. According to http://www.zlib.net/manual.html: "The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6)." #define Z_DEFAULT_COMPRESSION (-1) (zlib.h) What do you think about adding some clarification in PostgreSQL doc ? Regads, Grzegorz Szpetkowski