Re: ftell mismatch with expected position

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alban Hertroys <haramrae(at)gmail(dot)com>
Cc: Eelke Klein <eelke(at)bolt(dot)nl>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: ftell mismatch with expected position
Date: 2015-11-02 14:30:15
Message-ID: 23854.1446474615@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alban Hertroys <haramrae(at)gmail(dot)com> writes:
> Please refrain from top-posting.
> On 2 November 2015 at 10:48, Eelke Klein <eelke(at)bolt(dot)nl> wrote:
>> Normally we call this from within our windows program where a lot of code is
>> involved for setting up the environment, and creating the pipes and
>> redirecting stdout, stderr and stdin. However I believe it is the same
>> problem that can be caused with the following commandline in cmd.exe but you
>> will need to have Coreutils for windows installed to get the cat command.
>>
>> pg_dump.exe -U postgres --format=c mydb | cat > backupfile

> Do you also get the warning if you split those commands up, and if so,
> in which one?

Presumably it doesn't happen without the use of the pipe notation.

I suspect that what's happening is that stdout isn't getting put into
binary mode, so that Microsoft's CR/NL translation corrupts the data.
If that's true, though, the resulting backup file should be corrupt;
is it valid according to "pg_restore backupfile"?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Dearman 2015-11-02 15:32:08 Re: Waiting on ExclusiveLock on extension 9.3, 9.4 and 9.5
Previous Message Igor Bossenko 2015-11-02 13:20:48 Re: Is there bigintarray?