Re: BUG: pg_dump generates corrupted gzip file in Windows

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BUG: pg_dump generates corrupted gzip file in Windows
Date: 2017-06-19 06:12:25
Message-ID: CAE9k0P=PLo28tULwz84TkvUcJaVyBjQoLCggiyfn=Jo1qnGBBQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Fri, Mar 24, 2017 at 10:16 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Mar 24, 2017 at 6:44 AM, Kuntal Ghosh
> <kuntalghosh(dot)2007(at)gmail(dot)com> wrote:
>>> ASAICU, if we use binary mode, output is stored bit by bit. In ASCII
>>> mode, cmd pokes its nose and does CR / LF conversions on its own. So,
>>> whenever we want compression on a plain-text dump file, we can set the
>>> stdout mode to O_BINARY. Is it a wrong approach?
>> With the help from Ashutosh Sharma, I tested this in Windows
>> environment. Sadly, it still doesn't work. :( IMHO, we should document
>> the issue somewhere.
>
> Why not? I mean, if there's code there to force the output into
> binary mode, does that not work for the -Fc case? And if it does work
> for the -Fc case, then why doesn't it also work for -Z9?
>

I have re-verified the patch with the help of my colleague 'Neha
Sharma' on Windows server 2008 R2 machine and the fix looks to be
working fine. With the help of attached patch, i could see that when
pg_dump is ran in default mode (i.e. -Fp mode) with compression level
> 0 and output redirected to stdout, the dump file generated is not a
corrupted file and can be easily decompressed with the help of gzip
command and also it can be easily restored without any issues. Thanks.

Please note that earlier i was not able to reproduce the issue on my
windows setup and had to borrow Neha's machine to validate the fix.
Sorry, for the delayed response.

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-06-19 06:55:47 Re: BUG: pg_dump generates corrupted gzip file in Windows
Previous Message Amit Langote 2017-06-19 06:07:39 Setting pd_lower in GIN metapage