Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TN1XV-00039r-2E for pgsql-bugs@postgresql.org; Sat, 13 Oct 2012 13:14:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TN1XP-0000Ld-Hq for pgsql-bugs@postgresql.org; Sat, 13 Oct 2012 13:14:00 +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 q9DDDpee011326; Sat, 13 Oct 2012 09:13:52 -0400 (EDT) From: Tom Lane To: Craig Ringer cc: hrtlik@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #7590: Data corruption using pg_dump only with -Z parameter In-reply-to: <507959C8.1010300@ringerc.id.au> References: <2464.1349807895@sss.pgh.pa.us> <507959C8.1010300@ringerc.id.au> Comments: In-reply-to Craig Ringer message dated "Sat, 13 Oct 2012 20:08:40 +0800" Date: Sat, 13 Oct 2012 09:13:50 -0400 Message-ID: <11325.1350134030@sss.pgh.pa.us> X-Pg-Spam-Score: -4.0 (----) X-Archive-Number: 201210/118 X-Sequence-Number: 34418 Craig Ringer 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