From: Heikki Linnakangas Date: Mon, 10 Jan 2011 17:42:05 +0000 (+0200) Subject: Leave temporary files out of streaming base backups. X-Git-Tag: REL9_1_ALPHA4~474 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc1305ce5ffef157410b6e0171d71fa16da4cc9e;p=postgresql Leave temporary files out of streaming base backups. --- 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 */