Re: Re: [BUGS] BUG #14634: On Windows pg_basebackup should write tar to stdout in binary mode

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: henry_boehlert(at)agilent(dot)com, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [BUGS] BUG #14634: On Windows pg_basebackup should write tar to stdout in binary mode
Date: 2017-05-03 12:33:24
Message-ID: CAJrrPGdqacvLhGPh-ygej7tzOB6eT39gCox-dfHaG+pQ6KAsWw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Wed, May 3, 2017 at 3:20 PM, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:

> On 3 May 2017 at 12:32, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com> wrote:
> > [Adding -hackers mailing list]
> >
> > On Fri, Apr 28, 2017 at 6:28 PM, <henry_boehlert(at)agilent(dot)com> wrote:
> >>
> >> The following bug has been logged on the website:
> >>
> >> Bug reference: 14634
> >> Logged by: Henry Boehlert
> >> Email address: henry_boehlert(at)agilent(dot)com
> >> PostgreSQL version: 9.6.2
> >> Operating system: Windows Server 2012 R2 6.3.9600
> >> Description:
> >>
> >> Executing command pg_basebackup -D -F t writes its output to stdout,
> which
> >> is open in text mode, causing LF to be converted to CR LF thus
> corrupting
> >> the resulting archive.
> >>
> >> To write the tar to stdout, on Windows stdout's mode should be
> temporarily
> >> switched to binary.
> >>
> >> https://msdn.microsoft.com/en-us/library/tw4k6df8.aspx
> >
> >
> > Thanks for reporting the issue.
> > With the attached patch, I was able to extract the tar file that gets
> > generated when the tar file is written into stdout. I tested the
> > the compressed tar also.
> >
> > This bug needs to be fixed in back branches also.
>
> We should do the same for pg_dump in -Fc mode.

There are no "CR LF" characters that are present in the dump file
that is created with custom format.

what is the problem do you see in custom format that needs similar
handling like pg_basebackup?

Regards,
Hari Babu
Fujitsu Australia

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ashutosh Sharma 2017-05-03 12:44:02 Re: [HACKERS] Re: BUG #14634: On Windows pg_basebackup should write tar to stdout in binary mode
Previous Message Vitaliy Gomenyuk 2017-05-03 10:04:06 Re: BUG #14635: Query is executed slower on hot standby slave database then on master database

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-05-03 12:35:38 Re: scram and \password
Previous Message Michael Paquier 2017-05-03 12:25:43 Re: password_encryption, default and 'plain' support