Skip to content

Commit a8f2b43

Browse files
committed
fix template0 backup. Always copy all files of this database
1 parent 3246875 commit a8f2b43

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/backup.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,16 @@ make_pagemap_from_ptrack(parray *files)
23172317
*/
23182318
if (file->is_database)
23192319
{
2320+
char *filename = strrchr(file->path, '/');
2321+
2322+
Assert(filename != NULL);
2323+
filename++;
2324+
2325+
elog(ERROR, "filename %s", filename);
2326+
/* always backup all files from template0 */
2327+
if (strcmp(filename, "template0") == 0)
2328+
continue;
2329+
23202330
/*
23212331
* The function pg_ptrack_get_and_clear_db returns true
23222332
* if there was a ptrack_init file

src/dir.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ dir_list_file_internal(parray *files, const char *root, bool exclude,
384384
if (add_root)
385385
{
386386
/* Skip files */
387+
/* TODO Consider moving this check to parse_backup_filelist_filenames */
387388
if (!S_ISDIR(file->mode) && exclude)
388389
{
389390
char *file_name;

0 commit comments

Comments
 (0)