From dc1305ce5ffef157410b6e0171d71fa16da4cc9e Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 10 Jan 2011 19:42:05 +0200 Subject: [PATCH] Leave temporary files out of streaming base backups. --- src/backend/replication/basebackup.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index 0ebeef23b1..5cb395d818 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -276,6 +276,12 @@ sendDir(char *path, int basepathlen, bool sizeonly) if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) continue; + /* Skip temporary files */ + if (strncmp(de->d_name, + PG_TEMP_FILE_PREFIX, + strlen(PG_TEMP_FILE_PREFIX)) == 0) + continue; + snprintf(pathbuf, MAXPGPATH, "%s/%s", path, de->d_name); /* Skip postmaster.pid in the data directory */ -- 2.40.0