1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-08 00:47:37 +03:00

pg_combinebackup: Error message improvements

Make the wordings of some file-related error messages more like those
used in other files.
This commit is contained in:
Peter Eisentraut
2024-06-21 09:40:44 +02:00
parent aea79883c5
commit c5c82123d3
6 changed files with 32 additions and 34 deletions

View File

@@ -196,7 +196,7 @@ reconstruct_from_incremental_file(char *input_filename,
/* We need to know the length of the file. */
if (fstat(s->fd, &sb) < 0)
pg_fatal("could not stat \"%s\": %m", s->filename);
pg_fatal("could not stat file \"%s\": %m", s->filename);
/*
* Since we found a full file, source all blocks from it that
@@ -297,8 +297,7 @@ reconstruct_from_incremental_file(char *input_filename,
* The directory is out of sync with the backup_manifest, so emit
* a warning.
*/
/*- translator: the first %s is a backup manifest file, the second is a file absent therein */
pg_log_warning("\"%s\" contains no entry for \"%s\"",
pg_log_warning("manifest file \"%s\" contains no entry for file \"%s\"",
path,
manifest_path);
pfree(path);
@@ -354,7 +353,7 @@ reconstruct_from_incremental_file(char *input_filename,
if (s == NULL)
continue;
if (close(s->fd) != 0)
pg_fatal("could not close \"%s\": %m", s->filename);
pg_fatal("could not close file \"%s\": %m", s->filename);
if (s->relative_block_numbers != NULL)
pfree(s->relative_block_numbers);
pg_free(s->filename);
@@ -406,7 +405,7 @@ debug_reconstruction(int n_source, rfile **sources, bool dry_run)
struct stat sb;
if (fstat(s->fd, &sb) < 0)
pg_fatal("could not stat \"%s\": %m", s->filename);
pg_fatal("could not stat file \"%s\": %m", s->filename);
if (sb.st_size < s->highest_offset_read)
pg_fatal("file \"%s\" is too short: expected %llu, found %llu",
s->filename,
@@ -527,7 +526,7 @@ read_bytes(rfile *rf, void *buffer, unsigned length)
if (rb < 0)
pg_fatal("could not read file \"%s\": %m", rf->filename);
else
pg_fatal("could not read file \"%s\": read only %d of %u bytes",
pg_fatal("could not read file \"%s\": read %d of %u",
rf->filename, rb, length);
}
}
@@ -725,7 +724,7 @@ write_reconstructed_file(char *input_filename,
/* Close the output file. */
if (wfd >= 0 && close(wfd) != 0)
pg_fatal("could not close \"%s\": %m", output_filename);
pg_fatal("could not close file \"%s\": %m", output_filename);
}
/*
@@ -746,7 +745,7 @@ write_block(int fd, char *output_filename,
if (wb < 0)
pg_fatal("could not write file \"%s\": %m", output_filename);
else
pg_fatal("could not write file \"%s\": wrote only %d of %d bytes",
pg_fatal("could not write file \"%s\": wrote %d of %d",
output_filename, wb, BLCKSZ);
}
@@ -769,10 +768,9 @@ read_block(rfile *s, off_t off, uint8 *buffer)
if (rb != BLCKSZ)
{
if (rb < 0)
pg_fatal("could not read file \"%s\": %m", s->filename);
pg_fatal("could not read from file \"%s\": %m", s->filename);
else
pg_fatal("could not read file \"%s\": read only %d of %d bytes at offset %llu",
s->filename, rb, BLCKSZ,
(unsigned long long) off);
pg_fatal("could not read from file \"%s\", offset %llu: read %d of %d",
s->filename, (unsigned long long) off, rb, BLCKSZ);
}
}