mirror of
https://github.com/postgres/postgres.git
synced 2025-11-16 15:02:33 +03:00
Define PG_TBLSPC_DIR for path pg_tblspc/ in data folder
Similarly to 2065ddf5e3, 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
This commit is contained in:
@@ -123,8 +123,9 @@ GetDatabasePath(Oid dbOid, Oid spcOid)
|
||||
else
|
||||
{
|
||||
/* All other tablespaces are accessed via symlinks */
|
||||
return psprintf("pg_tblspc/%u/%s/%u",
|
||||
spcOid, TABLESPACE_VERSION_DIRECTORY, dbOid);
|
||||
return psprintf("%s/%u/%s/%u",
|
||||
PG_TBLSPC_DIR, spcOid,
|
||||
TABLESPACE_VERSION_DIRECTORY, dbOid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,25 +185,29 @@ GetRelationPath(Oid dbOid, Oid spcOid, RelFileNumber relNumber,
|
||||
if (procNumber == INVALID_PROC_NUMBER)
|
||||
{
|
||||
if (forkNumber != MAIN_FORKNUM)
|
||||
path = psprintf("pg_tblspc/%u/%s/%u/%u_%s",
|
||||
spcOid, TABLESPACE_VERSION_DIRECTORY,
|
||||
path = psprintf("%s/%u/%s/%u/%u_%s",
|
||||
PG_TBLSPC_DIR, spcOid,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
dbOid, relNumber,
|
||||
forkNames[forkNumber]);
|
||||
else
|
||||
path = psprintf("pg_tblspc/%u/%s/%u/%u",
|
||||
spcOid, TABLESPACE_VERSION_DIRECTORY,
|
||||
path = psprintf("%s/%u/%s/%u/%u",
|
||||
PG_TBLSPC_DIR, spcOid,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
dbOid, relNumber);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (forkNumber != MAIN_FORKNUM)
|
||||
path = psprintf("pg_tblspc/%u/%s/%u/t%d_%u_%s",
|
||||
spcOid, TABLESPACE_VERSION_DIRECTORY,
|
||||
path = psprintf("%s/%u/%s/%u/t%d_%u_%s",
|
||||
PG_TBLSPC_DIR, spcOid,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
dbOid, procNumber, relNumber,
|
||||
forkNames[forkNumber]);
|
||||
else
|
||||
path = psprintf("pg_tblspc/%u/%s/%u/t%d_%u",
|
||||
spcOid, TABLESPACE_VERSION_DIRECTORY,
|
||||
path = psprintf("%s/%u/%s/%u/t%d_%u",
|
||||
PG_TBLSPC_DIR, spcOid,
|
||||
TABLESPACE_VERSION_DIRECTORY,
|
||||
dbOid, procNumber, relNumber);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user