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

Indeed, it only happens when a pipe is involved.


>
> 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"?
>

Yes pg_restore restores it without problems. However I did notice that it
is larger then normal.

I have also tested what happens on freebsd when using a pipe and there are
no warnings and backup is expected size.

I dug into the source code of pg_dump and found that the warning is given
by _getFilePos(ArchiveHandle *AH, lclContext *ctx) in pg_backup_custom.c
but it won't  if ctx->hasSeek is set to false. Which is initialized by a
call to checkSeek in pg_backup_archiver.c. Unfortunatly I'm not yet able to
build and debug ton windows to verify if a correction to this function
would help.

regards, Eelke

Reply via email to