Re: BUG #7590: Data corruption using pg_dump only with -Z parameter

From: Jan Vodička <hrtlik(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7590: Data corruption using pg_dump only with -Z parameter
Date: 2012-10-13 13:28:08
Message-ID: CA+8ZZi+ppA3iSCk8xtgbR7M7u99Aw-6pTLWiLgLa02PDwf7kXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks. I've already looked. Problem was that Windows replaced '\n' to
'\r\n', replacing bytes back '\r\n' -> '\n' solved the problem. It was
working on 16GB gzip package.
It should be nice to mention this behavior somewhere.

Jan Vodicka

2012/10/13 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> writes:
> > On 10/10/2012 02:38 AM, Tom Lane wrote:
> >> On Windows, that doesn't seem terribly surprising: Windows will probably
> >> do newline munging on the process's stdout, which will corrupt
> >> compressed data since it's not plain text.
>
> > pg_dump might want to refuse to write to stdout when in a non-plain-text
> > mode on Windows if that's the case.
>
> Actually, a look at the pg_dump code says that it does
>
> setmode(fileno(stdout), O_BINARY);
>
> so either my diagnosis is wrong or there's some reason why that setting
> didn't take.
>
> regards, tom lane
>

--
Jan Vodička

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Fujii Masao 2012-10-13 16:35:12 Re: BUG #7534: walreceiver takes long time to detect n/w breakdown
Previous Message Tom Lane 2012-10-13 13:13:50 Re: BUG #7590: Data corruption using pg_dump only with -Z parameter