]> granicus.if.org Git - postgresql/commitdiff
Leave temporary files out of streaming base backups.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 10 Jan 2011 17:42:05 +0000 (19:42 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 10 Jan 2011 17:42:05 +0000 (19:42 +0200)
src/backend/replication/basebackup.c

index 0ebeef23b1ffdbb4a418081cd00d130865ce50e0..5cb395d818e511f62717405f47712f56f7c0a57d 100644 (file)
@@ -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 */