static int path_cmp(const void *a, const void *b);
static int final_filemap_cmp(const void *a, const void *b);
static void filemap_list_to_array(filemap_t *map);
-static bool check_file_excluded(const char *path, const char *type);
+static bool check_file_excluded(const char *path, bool is_source);
/*
* The contents of these directories are removed or recreated during server
Assert(map->array == NULL);
/* ignore any path matching the exclusion filters */
- if (check_file_excluded(path, "source"))
+ if (check_file_excluded(path, true))
return;
/*
* mandatory for target files, but this does not hurt and let's be
* consistent with the source processing.
*/
- if (check_file_excluded(path, "target"))
+ if (check_file_excluded(path, false))
return;
snprintf(localpath, sizeof(localpath), "%s/%s", datadir_target, path);
* Is this the path of file that pg_rewind can skip copying?
*/
static bool
-check_file_excluded(const char *path, const char *type)
+check_file_excluded(const char *path, bool is_source)
{
char localpath[MAXPGPATH];
int excludeIdx;
filename++;
if (strcmp(filename, excludeFiles[excludeIdx]) == 0)
{
- pg_log(PG_DEBUG, "entry \"%s\" excluded from %s file list\n",
- path, type);
+ if (is_source)
+ pg_log(PG_DEBUG, "entry \"%s\" excluded from source file list\n",
+ path);
+ else
+ pg_log(PG_DEBUG, "entry \"%s\" excluded from target file list\n",
+ path);
return true;
}
}
excludeDirContents[excludeIdx]);
if (strstr(path, localpath) == path)
{
- pg_log(PG_DEBUG, "entry \"%s\" excluded from %s file list\n",
- path, type);
+ if (is_source)
+ pg_log(PG_DEBUG, "entry \"%s\" excluded from source file list\n",
+ path);
+ else
+ pg_log(PG_DEBUG, "entry \"%s\" excluded from target file list\n",
+ path);
return true;
}
}
break;
if (r != BLCKSZ)
{
- fprintf(stderr, _("%s: short read of block %u in file \"%s\", got only %d bytes\n"),
- progname, blockno, fn, r);
+ fprintf(stderr, _("%s: could not read block %u in file \"%s\": read %d of %d\n"),
+ progname, blockno, fn, r, BLCKSZ);
exit(1);
}
blocks++;
fprintf(output, _(" HISTFILE\n"
" file name used to store the command history\n"));
fprintf(output, _(" HISTSIZE\n"
- " max number of commands to store in the command history\n"));
+ " maximum number of commands to store in the command history\n"));
fprintf(output, _(" HOST\n"
" the currently connected database server host\n"));
fprintf(output, _(" IGNOREEOF\n"