From: Kyotaro Horiguchi Date: Tue, 29 Sep 2020 23:19:58 +0900 Subject: [PATCH v56 6/6] Exclude pg_stat directory from base backup basebackup sends the content of pg_stat directory, which is doomed to be removed at startup from the backup. Now that pg_stat_statements saves a temporary file into the directory, let exclude pg_stat directory from a base backup. --- src/backend/replication/basebackup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index f0d75f55bd..f54fcec70a 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -149,6 +149,13 @@ struct exclude_list_item */ static const char *const excludeDirContents[] = { + /* + * Skip statistics files. PGSTAT_STAT_PERMANENT_DIRECTORY must be skipped + * because the files in the directory will be removed at startup from the + * backup. + */ + PGSTAT_STAT_PERMANENT_DIRECTORY, + /* * It is generally not useful to backup the contents of this directory * even if the intention is to restore to another primary. See backup.sgml -- 2.27.0 ----Next_Part(Tue_Mar_16_10_27_55_2021_500)----