Re: ftell mismatch with expected position

Поиск
Список
Период
Сортировка
От Eelke Klein
Тема Re: ftell mismatch with expected position
Дата
Msg-id CALEkvvwkGeD4SmxRjKLuU0_EXHRPVKeTKgVu5zSQjrYUjYoLHQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ftell mismatch with expected position  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: is there any difference DROP PRIMARY KEY in oracle and postgres?
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: pg_archivecleanup not deleting anything?