[HACKERS] [patch] pg_dump/pg_restore zerror() and strerror() mishap

Поиск
Список
Период
Сортировка
От Kunshchikov Vladimir
Тема [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror() mishap
Дата
Msg-id 1498120508308.9826@infotecs.ru
обсуждение исходный текст
Ответы Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror()mishap  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror()mishap  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hello,

    our testing team has noticed apparently wrong backup/restore error messages like this:


pg_restore: [compress_io] could not read from input file: success
pg_dump: [directory archiver] could not write to output file: success

 

Such "success" messages are caused by calling strerror() after gzread()/gzwrite() failures.  In order to properly decode errors, there should be used  gzerror() instead of strerror():
 http://refspecs.linuxbase.org/LSB_2.1.0/LSB-generic/LSB-generic/zlib-gzerror-1.html

Errors should be like this:
pg_restore: [compress_io] could not read from input file: d3/2811.dat.gz: invalid distance too far back

Attached small fix for this issue.

You can view that patch  online on our github:
https://github.com/Infotecs/postgres/commit/1578f5011ad22d78ae059a4ef0924426fd6db762


--
Best regards,
Vladimir Kunschikov
Lead software developer
IDS project
InfoTeCS JSC

Вложения

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

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: [HACKERS] Incorrect documentation about pg_stat_activity
Следующее
От: Yugo Nagata
Дата:
Сообщение: Re: [HACKERS] Incorrect documentation about pg_stat_activity