postgresql/src/bin/pg_rewind
Michael Paquier 811b6e36a9 Rework error messages around file handling
Some error messages related to file handling are using the code path
context to define their state.  For example, 2PC-related errors are
referring to "two-phase status files", or "relation mapping file" is
used for catalog-to-filenode mapping, however those prove to be
difficult to translate, and are not more helpful than just referring to
the path of the file being worked on.  So simplify all those error
messages by just referring to files with their path used.  In some
cases, like the manipulation of WAL segments, the context is actually
helpful so those are kept.

Calls to the system function read() have also been rather inconsistent
with their error handling sometimes not reporting the number of bytes
read, and some other code paths trying to use an errno which has not
been set.  The in-core functions are using a more consistent pattern
with this patch, which checks for both errno if set or if an
inconsistent read is happening.

So as to care about pluralization when reading an unexpected number of
byte(s), "could not read: read %d of %zu" is used as error message, with
%d field being the output result of read() and %zu the expected size.
This simplifies the work of translators with less variations of the same
message.

Author: Michael Paquier
Reviewed-by: Álvaro Herrera
Discussion: https://postgr.es/m/20180520000522.GB1603@paquier.xyz
2018-07-18 08:01:23 +09:00
..
po Translation updates 2018-05-21 12:29:52 -04:00
t Don't fall off the end of perl functions 2018-05-27 09:08:42 -04:00
.gitignore Improve logging of TAP tests. 2015-07-09 13:19:10 +03:00
copy_fetch.c Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
datapagemap.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
datapagemap.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
fetch.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
fetch.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
file_ops.c Rework error messages around file handling 2018-07-18 08:01:23 +09:00
file_ops.h Fix handling of files that source server removes during pg_rewind is running. 2018-03-29 04:00:21 +09:00
filemap.c Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
filemap.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
libpq_fetch.c Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
logging.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
logging.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
nls.mk Translation updates 2018-05-21 12:29:52 -04:00
parsexlog.c Rework error messages around file handling 2018-07-18 08:01:23 +09:00
pg_rewind.c Add pg_rewind --no-sync 2018-07-10 08:51:10 +09:00
pg_rewind.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
RewindTest.pm Add pg_rewind --no-sync 2018-07-10 08:51:10 +09:00
timeline.c Update copyright for 2018 2018-01-02 23:30:12 -05:00