Re: [patch] pg_dump/pg_restore zerror() and strerror() mishap
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Kunshchikov Vladimir <Vladimir.Kunshchikov@infotecs.ru>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-08-02T22:36:00Z
Lists: pgsql-hackers
Kunshchikov Vladimir wrote: > Hello Alvaro, > > here goes v4 version: removed unused header. > > Compilation of this code snippet with -Wall -Wexter -std=c89 doesn't produce any warnings. Great, thanks! I have pushed this to all branches since 9.4. Would you please give it a look? Please let me know if you find any problems (particularly since you seem to have a test rig to verify it on corrupted files). I noticed that with this patch we no longer use WRITE_ERROR_EXIT in certain cases but instead do the printing/exiting directly. I think that's fine, but it would be neater to improve the WRITE_ERROR_EXIT macro so that it takes the cfp as an argument, and then the macro is in charge of calling get_cfp_error. But then I noticed that it wasn't very easy to improve things that way. I also noticed that the usage of mixed compressed/uncompressed file pointers in pg_dump is not very consistent, and it would take rather a lot of effort to clean up. So I gave up for now, particularly as a backpatchable bugfix. If you're interested in mop-up work, I think we can improve pg_dump some more there. At least, I think most common cases should correctly report any zlib problems now. Thanks for the patch! -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix pg_dump's errno checking for zlib I/O
- 4d57e8381677 10.0 landed
- f3142c027212 9.5.8 landed
- 060393f2a136 9.6.4 landed
- 330e68734b82 9.4.13 landed
-
Add pg_basebackup tool for streaming base backups
- 048d148fe631 9.1.0 cited