From c7cd2d6ed082a4638172acece33ed6f36da96263 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 3 Sep 2024 09:11:54 +0900 Subject: Define PG_TBLSPC_DIR for path pg_tblspc/ in data folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similarly to 2065ddf5e34c, this introduces a define for "pg_tblspc". This makes the style more consistent with the existing PG_STAT_TMP_DIR, for example. There is a difference with the other cases with the introduction of PG_TBLSPC_DIR_SLASH, required in two places for recovery and backups. Author: Bertrand Drouvot Reviewed-by: Ashutosh Bapat, Álvaro Herrera, Yugo Nagata, Michael Paquier Discussion: https://postgr.es/m/ZryVvjqS9SnV1GPP@ip-10-97-1-34.eu-west-3.compute.internal --- src/common/file_utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/common/file_utils.c') diff --git a/src/common/file_utils.c b/src/common/file_utils.c index 6bac537a1e5..398fe1c334d 100644 --- a/src/common/file_utils.c +++ b/src/common/file_utils.c @@ -28,6 +28,7 @@ #ifdef FRONTEND #include "common/logging.h" #endif +#include "common/relpath.h" #include "port/pg_iovec.h" #ifdef FRONTEND @@ -105,7 +106,7 @@ sync_pgdata(const char *pg_data, /* handle renaming of pg_xlog to pg_wal in post-10 clusters */ snprintf(pg_wal, MAXPGPATH, "%s/%s", pg_data, serverVersion < MINIMUM_VERSION_FOR_PG_WAL ? "pg_xlog" : "pg_wal"); - snprintf(pg_tblspc, MAXPGPATH, "%s/pg_tblspc", pg_data); + snprintf(pg_tblspc, MAXPGPATH, "%s/%s", pg_data, PG_TBLSPC_DIR); /* * If pg_wal is a symlink, we'll need to recurse into it separately, -- cgit v1.2.3