aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 2de21051052..25107e8a290 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -307,8 +307,6 @@ static int FreeDesc(AllocateDesc *desc);
static void AtProcExit_Files(int code, Datum arg);
static void CleanupTempFiles(bool isCommit, bool isProcExit);
-static void RemovePgTempFilesInDir(const char *tmpdirname, bool missing_ok,
- bool unlink_all);
static void RemovePgTempRelationFiles(const char *tsdirname);
static void RemovePgTempRelationFilesInDbspace(const char *dbspacedirname);
@@ -2919,11 +2917,10 @@ RemovePgTempFiles(void)
/*
* In EXEC_BACKEND case there is a pgsql_tmp directory at the top level of
- * DataDir as well.
+ * DataDir as well. However, that is *not* cleaned here because doing so
+ * would create a race condition. It's done separately, earlier in
+ * postmaster startup.
*/
-#ifdef EXEC_BACKEND
- RemovePgTempFilesInDir(PG_TEMP_FILES_DIR, true, false);
-#endif
}
/*
@@ -2941,7 +2938,7 @@ RemovePgTempFiles(void)
* (These two flags could be replaced by one, but it seems clearer to keep
* them separate.)
*/
-static void
+void
RemovePgTempFilesInDir(const char *tmpdirname, bool missing_ok, bool unlink_all)
{
DIR *temp_dir;