*** a/src/backend/replication/basebackup.c --- b/src/backend/replication/basebackup.c *************** *** 862,871 **** sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces) if (strcmp(de->d_name, BACKUP_LABEL_FILE) == 0) continue; - /* Skip pg_replslot, not useful to copy */ - if (strcmp(de->d_name, "pg_replslot") == 0) - continue; - /* * Check if the postmaster has signaled us to exit, and abort with an * error in that case. The error handler further up will call --- 862,867 ---- *************** *** 907,912 **** sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces) --- 903,920 ---- } /* + * We can skip replication slot files. But include it as an empty + * direcotry anyway. + */ + if (strcmp(pathbuf, "./pg_replslot") == 0) + { + if (!sizeonly) + _tarWriteHeader(pathbuf + basepathlen + 1, NULL, &statbuf); + size += 512; + continue; + } + + /* * Skip temporary statistics files. PG_STAT_TMP_DIR must be skipped * even when stats_temp_directory is set because PGSS_TEXT_FILE is * always created there.