Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-06-19 Thread Tom Lane
I wrote: > That patch looks reasonable to me, will push. On closer inspection, the patch did contain a bug: it tested for compression being active with "compression > 0", which is the wrong thing --- everyplace else in pg_dump tests with "compression != 0". This is important because Z_DEFAULT_COMP

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-06-19 Thread Tom Lane
Ashutosh Sharma writes: > On Mon, Jun 19, 2017 at 12:25 PM, Amit Kapila wrote: >> On Mon, Jun 19, 2017 at 11:42 AM, Ashutosh Sharma >> wrote: >>> On Fri, Mar 24, 2017 at 10:16 PM, Robert Haas wrote: Why not? I mean, if there's code there to force the output into binary mode, does th

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-06-19 Thread Ashutosh Sharma
Hi, On Mon, Jun 19, 2017 at 12:25 PM, Amit Kapila wrote: > On Mon, Jun 19, 2017 at 11:42 AM, Ashutosh Sharma > wrote: >> Hi, >> >> On Fri, Mar 24, 2017 at 10:16 PM, Robert Haas wrote: >>> On Fri, Mar 24, 2017 at 6:44 AM, Kuntal Ghosh >>> wrote: > ASAICU, if we use binary mode, output is s

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-06-18 Thread Amit Kapila
On Mon, Jun 19, 2017 at 11:42 AM, Ashutosh Sharma wrote: > Hi, > > On Fri, Mar 24, 2017 at 10:16 PM, Robert Haas wrote: >> On Fri, Mar 24, 2017 at 6:44 AM, Kuntal Ghosh >> wrote: ASAICU, if we use binary mode, output is stored bit by bit. In ASCII mode, cmd pokes its nose and does CR /

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-06-18 Thread Ashutosh Sharma
Hi, On Fri, Mar 24, 2017 at 10:16 PM, Robert Haas wrote: > On Fri, Mar 24, 2017 at 6:44 AM, Kuntal Ghosh > 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

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 6:44 AM, Kuntal Ghosh 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

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Kuntal Ghosh
On Fri, Mar 24, 2017 at 2:17 PM, Kuntal Ghosh wrote: > On Fri, Mar 24, 2017 at 12:35 PM, Craig Ringer wrote: >> On 24 March 2017 at 14:07, Kuntal Ghosh wrote: >>> On Fri, Mar 24, 2017 at 11:28 AM, Kuntal Ghosh >>> wrote: Hello, In Windows, if one needs to take a dump in plain text for

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Kuntal Ghosh
On Fri, Mar 24, 2017 at 12:35 PM, Craig Ringer wrote: > On 24 March 2017 at 14:07, Kuntal Ghosh wrote: >> On Fri, Mar 24, 2017 at 11:28 AM, Kuntal Ghosh >> wrote: >>> Hello, >>> In Windows, if one needs to take a dump in plain text format (this is >>> the default option, or can be specified usin

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Craig Ringer
On 24 March 2017 at 14:07, Kuntal Ghosh wrote: > On Fri, Mar 24, 2017 at 11:28 AM, Kuntal Ghosh > wrote: >> Hello, >> In Windows, if one needs to take a dump in plain text format (this is >> the default option, or can be specified using -Fp) with some level of >> compression (-Z[0-9]), an output

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-23 Thread Kuntal Ghosh
On Fri, Mar 24, 2017 at 11:28 AM, Kuntal Ghosh wrote: > Hello, > In Windows, if one needs to take a dump in plain text format (this is > the default option, or can be specified using -Fp) with some level of > compression (-Z[0-9]), an output file has to > be specified. Otherwise, if the output is

[HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-23 Thread Kuntal Ghosh
Hello, In Windows, if one needs to take a dump in plain text format (this is the default option, or can be specified using -Fp) with some level of compression (-Z[0-9]), an output file has to be specified. Otherwise, if the output is redirected to stdout, it'll create a corrupted dump (cmd is set t