aboutsummaryrefslogtreecommitdiff
path: root/src/include/common/file_utils.h
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2023-09-05 17:02:06 -0700
committerNathan Bossart <nathan@postgresql.org>2023-09-05 17:02:06 -0700
commitf39b265808bde307953dd4bd46dca1f58f0988e8 (patch)
tree142201a17026ae2a4bd65905e1012f68d68372cb /src/include/common/file_utils.h
parent119c23eb9819213551cbe7e7665c8b493c59ceee (diff)
downloadpostgresql-f39b265808bde307953dd4bd46dca1f58f0988e8.tar.gz
postgresql-f39b265808bde307953dd4bd46dca1f58f0988e8.zip
Move PG_TEMP_FILE* macros to file_utils.h.
Presently, frontend code that needs to use these macros must either include storage/fd.h, which declares several frontend-unsafe functions, or duplicate the macros. This commit moves these macros to common/file_utils.h, which is safe for both frontend and backend code. Consequently, we can also remove the duplicated macros in pg_checksums and stop including storage/fd.h in pg_rewind. Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/ZOP5qoUualu5xl2Z%40paquier.xyz
Diffstat (limited to 'src/include/common/file_utils.h')
-rw-r--r--src/include/common/file_utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/common/file_utils.h b/src/include/common/file_utils.h
index b7efa1226d6..dd1532bcb06 100644
--- a/src/include/common/file_utils.h
+++ b/src/include/common/file_utils.h
@@ -46,4 +46,8 @@ extern ssize_t pg_pwritev_with_retry(int fd,
extern ssize_t pg_pwrite_zeros(int fd, size_t size, off_t offset);
+/* Filename components */
+#define PG_TEMP_FILES_DIR "pgsql_tmp"
+#define PG_TEMP_FILE_PREFIX "pgsql_tmp"
+
#endif /* FILE_UTILS_H */