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/backend/utils/adt/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/misc.c') diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c index 0e6c45807a1..1aa8bbb3063 100644 --- a/src/backend/utils/adt/misc.c +++ b/src/backend/utils/adt/misc.c @@ -242,7 +242,7 @@ pg_tablespace_databases(PG_FUNCTION_ARGS) if (tablespaceOid == DEFAULTTABLESPACE_OID) location = "base"; else - location = psprintf("pg_tblspc/%u/%s", tablespaceOid, + location = psprintf("%s/%u/%s", PG_TBLSPC_DIR, tablespaceOid, TABLESPACE_VERSION_DIRECTORY); dirdesc = AllocateDir(location); @@ -325,7 +325,7 @@ pg_tablespace_location(PG_FUNCTION_ARGS) * Find the location of the tablespace by reading the symbolic link that * is in pg_tblspc/. */ - snprintf(sourcepath, sizeof(sourcepath), "pg_tblspc/%u", tablespaceOid); + snprintf(sourcepath, sizeof(sourcepath), "%s/%u", PG_TBLSPC_DIR, tablespaceOid); /* * Before reading the link, check if the source path is a link or a -- cgit v1.2.3