Skip to content

Commit f48fa2b

Browse files
committed
Message style improvements
Fix one untranslatable string concatenation in pg_rewind. Fix one message in pg_verify_checksums to use a style use elsewhere and avoid plural issues. Fix one gratuitous abbreviation in psql.
1 parent 240d40d commit f48fa2b

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

src/bin/pg_rewind/filemap.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static char *datasegpath(RelFileNode rnode, ForkNumber forknum,
3030
static int path_cmp(const void *a, const void *b);
3131
static int final_filemap_cmp(const void *a, const void *b);
3232
static void filemap_list_to_array(filemap_t *map);
33-
static bool check_file_excluded(const char *path, const char *type);
33+
static bool check_file_excluded(const char *path, bool is_source);
3434

3535
/*
3636
* The contents of these directories are removed or recreated during server
@@ -148,7 +148,7 @@ process_source_file(const char *path, file_type_t type, size_t newsize,
148148
Assert(map->array == NULL);
149149

150150
/* ignore any path matching the exclusion filters */
151-
if (check_file_excluded(path, "source"))
151+
if (check_file_excluded(path, true))
152152
return;
153153

154154
/*
@@ -338,7 +338,7 @@ process_target_file(const char *path, file_type_t type, size_t oldsize,
338338
* mandatory for target files, but this does not hurt and let's be
339339
* consistent with the source processing.
340340
*/
341-
if (check_file_excluded(path, "target"))
341+
if (check_file_excluded(path, false))
342342
return;
343343

344344
snprintf(localpath, sizeof(localpath), "%s/%s", datadir_target, path);
@@ -490,7 +490,7 @@ process_block_change(ForkNumber forknum, RelFileNode rnode, BlockNumber blkno)
490490
* Is this the path of file that pg_rewind can skip copying?
491491
*/
492492
static bool
493-
check_file_excluded(const char *path, const char *type)
493+
check_file_excluded(const char *path, bool is_source)
494494
{
495495
char localpath[MAXPGPATH];
496496
int excludeIdx;
@@ -506,8 +506,12 @@ check_file_excluded(const char *path, const char *type)
506506
filename++;
507507
if (strcmp(filename, excludeFiles[excludeIdx]) == 0)
508508
{
509-
pg_log(PG_DEBUG, "entry \"%s\" excluded from %s file list\n",
510-
path, type);
509+
if (is_source)
510+
pg_log(PG_DEBUG, "entry \"%s\" excluded from source file list\n",
511+
path);
512+
else
513+
pg_log(PG_DEBUG, "entry \"%s\" excluded from target file list\n",
514+
path);
511515
return true;
512516
}
513517
}
@@ -522,8 +526,12 @@ check_file_excluded(const char *path, const char *type)
522526
excludeDirContents[excludeIdx]);
523527
if (strstr(path, localpath) == path)
524528
{
525-
pg_log(PG_DEBUG, "entry \"%s\" excluded from %s file list\n",
526-
path, type);
529+
if (is_source)
530+
pg_log(PG_DEBUG, "entry \"%s\" excluded from source file list\n",
531+
path);
532+
else
533+
pg_log(PG_DEBUG, "entry \"%s\" excluded from target file list\n",
534+
path);
527535
return true;
528536
}
529537
}

src/bin/pg_verify_checksums/pg_verify_checksums.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ scan_file(const char *fn, BlockNumber segmentno)
9999
break;
100100
if (r != BLCKSZ)
101101
{
102-
fprintf(stderr, _("%s: short read of block %u in file \"%s\", got only %d bytes\n"),
103-
progname, blockno, fn, r);
102+
fprintf(stderr, _("%s: could not read block %u in file \"%s\": read %d of %d\n"),
103+
progname, blockno, fn, r, BLCKSZ);
104104
exit(1);
105105
}
106106
blocks++;

src/bin/psql/help.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ helpVariables(unsigned short int pager)
369369
fprintf(output, _(" HISTFILE\n"
370370
" file name used to store the command history\n"));
371371
fprintf(output, _(" HISTSIZE\n"
372-
" max number of commands to store in the command history\n"));
372+
" maximum number of commands to store in the command history\n"));
373373
fprintf(output, _(" HOST\n"
374374
" the currently connected database server host\n"));
375375
fprintf(output, _(" IGNOREEOF\n"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy