Re: BUG #12779: pg_dump -Fd doesn't care about -Z

From: Christoph Berg <christoph(dot)berg(at)credativ(dot)de>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12779: pg_dump -Fd doesn't care about -Z
Date: 2015-02-18 09:17:12
Message-ID: 20150218091712.GA26116@msg.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Re: Michael Paquier 2015-02-18 <CAB7nPqTLSv5qES=9hODzkX62V5XcivP1ij=_iahR_-SriD2AOA(at)mail(dot)gmail(dot)com>
> On Wed, Feb 18, 2015 at 3:52 AM, Tom Lane wrote:
> > This doesn't look tremendously hard to fix, but it's not a one-liner
> > either. Don't have time for it personally right now.
>
> Interesting. The call to gzopen is missing the compression level,
> always passing either 'w' or 'wb', while for example to write with a
> compression level of 6 we should pass w6 or wb6.
>
> The patch attached addresses that.

The patch works for me:

$ paste <(du ?.fd) <(du ?.fd.patched)
5392 0.fd 5392 0.fd.patched
1164 1.fd 1492 1.fd.patched
1164 2.fd 1448 2.fd.patched
1164 3.fd 1400 3.fd.patched
1164 4.fd 1244 4.fd.patched
1164 5.fd 1156 5.fd.patched
1164 6.fd 1164 6.fd.patched
1164 7.fd 1164 7.fd.patched
1164 8.fd 1164 8.fd.patched
1164 9.fd 1164 9.fd.patched

(I guess the next step would be to support other compressors, xz
yields a 860kB backup on this trivial test data...)

Mit freundlichen Grüßen,
Christoph Berg
--
Senior Berater, Tel.: +49 (0)21 61 / 46 43-187
credativ GmbH, HRB Mönchengladbach 12080, USt-ID-Nummer: DE204566209
Hohenzollernstr. 133, 41061 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer
pgp fingerprint: 5C48 FE61 57F4 9179 5970 87C6 4C5A 6BAB 12D2 A7AE

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message patl659in 2015-02-18 15:45:51 BUG #12782: Some abnormal observation about the to_date() function in greenplum database
Previous Message Michael Paquier 2015-02-18 05:59:17 Re: BUG #12779: pg_dump -Fd doesn't care about -Z