summaryrefslogtreecommitdiff
path: root/src/backend/backup
diff options
context:
space:
mode:
authorMichael Paquier2024-09-03 00:11:54 +0000
committerMichael Paquier2024-09-03 00:11:54 +0000
commitc7cd2d6ed082a4638172acece33ed6f36da96263 (patch)
treef4a8ab1b49eac09019d6b6a6114e9d9a00e9f1a8 /src/backend/backup
parent94eec79633f284488de69e253857e44aad10c730 (diff)
Define PG_TBLSPC_DIR for path pg_tblspc/ in data folder
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
Diffstat (limited to 'src/backend/backup')
-rw-r--r--src/backend/backup/backup_manifest.c3
-rw-r--r--src/backend/backup/basebackup.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/backup/backup_manifest.c b/src/backend/backup/backup_manifest.c
index 4357cfa31de..a2e2f86332a 100644
--- a/src/backend/backup/backup_manifest.c
+++ b/src/backend/backup/backup_manifest.c
@@ -16,6 +16,7 @@
#include "access/xlog.h"
#include "backup/backup_manifest.h"
#include "backup/basebackup_sink.h"
+#include "common/relpath.h"
#include "mb/pg_wchar.h"
#include "utils/builtins.h"
#include "utils/json.h"
@@ -117,7 +118,7 @@ AddFileToBackupManifest(backup_manifest_info *manifest, Oid spcoid,
*/
if (OidIsValid(spcoid))
{
- snprintf(pathbuf, sizeof(pathbuf), "pg_tblspc/%u/%s", spcoid,
+ snprintf(pathbuf, sizeof(pathbuf), "%s/%u/%s", PG_TBLSPC_DIR, spcoid,
pathname);
pathname = pathbuf;
}
diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c
index de16afac749..14e5ba72e97 100644
--- a/src/backend/backup/basebackup.c
+++ b/src/backend/backup/basebackup.c
@@ -1488,7 +1488,7 @@ sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly,
if (OidIsValid(spcoid))
{
relspcoid = spcoid;
- lookup_path = psprintf("pg_tblspc/%u/%s", spcoid,
+ lookup_path = psprintf("%s/%u/%s", PG_TBLSPC_DIR, spcoid,
tarfilename);
}
else