@@ -1790,8 +1790,8 @@ TempTablespacePath(char *path, Oid tablespace)
17901790else
17911791{
17921792/* All other tablespaces are accessed via symlinks */
1793- snprintf (path ,MAXPGPATH ,"pg_tblspc /%u/%s/%s" ,
1794- tablespace ,TABLESPACE_VERSION_DIRECTORY ,
1793+ snprintf (path ,MAXPGPATH ,"%s /%u/%s/%s" ,
1794+ PG_TBLSPC_DIR , tablespace ,TABLESPACE_VERSION_DIRECTORY ,
17951795PG_TEMP_FILES_DIR );
17961796}
17971797}
@@ -3296,7 +3296,7 @@ CleanupTempFiles(bool isCommit, bool isProcExit)
32963296void
32973297RemovePgTempFiles (void )
32983298{
3299- char temp_path [MAXPGPATH + 10 + sizeof (TABLESPACE_VERSION_DIRECTORY )+ sizeof (PG_TEMP_FILES_DIR )];
3299+ char temp_path [MAXPGPATH + sizeof ( PG_TBLSPC_DIR ) + sizeof (TABLESPACE_VERSION_DIRECTORY )+ sizeof (PG_TEMP_FILES_DIR )];
33003300DIR * spc_dir ;
33013301struct dirent * spc_de ;
33023302
@@ -3310,20 +3310,21 @@ RemovePgTempFiles(void)
33103310/*
33113311 * Cycle through temp directories for all non-default tablespaces.
33123312 */
3313- spc_dir = AllocateDir ("pg_tblspc" );
3313+ spc_dir = AllocateDir (PG_TBLSPC_DIR );
33143314
3315- while ((spc_de = ReadDirExtended (spc_dir ,"pg_tblspc" ,LOG ))!= NULL )
3315+ while ((spc_de = ReadDirExtended (spc_dir ,PG_TBLSPC_DIR ,LOG ))!= NULL )
33163316{
33173317if (strcmp (spc_de -> d_name ,"." )== 0 ||
33183318strcmp (spc_de -> d_name ,".." )== 0 )
33193319continue ;
33203320
3321- snprintf (temp_path ,sizeof (temp_path ),"pg_tblspc/%s/%s/%s" ,
3322- spc_de -> d_name ,TABLESPACE_VERSION_DIRECTORY ,PG_TEMP_FILES_DIR );
3321+ snprintf (temp_path ,sizeof (temp_path ),"%s/%s/%s/%s" ,
3322+ PG_TBLSPC_DIR ,spc_de -> d_name ,TABLESPACE_VERSION_DIRECTORY ,
3323+ PG_TEMP_FILES_DIR );
33233324RemovePgTempFilesInDir (temp_path , true, false);
33243325
3325- snprintf (temp_path ,sizeof (temp_path ),"pg_tblspc /%s/%s" ,
3326- spc_de -> d_name ,TABLESPACE_VERSION_DIRECTORY );
3326+ snprintf (temp_path ,sizeof (temp_path ),"%s /%s/%s" ,
3327+ PG_TBLSPC_DIR , spc_de -> d_name ,TABLESPACE_VERSION_DIRECTORY );
33273328RemovePgTempRelationFiles (temp_path );
33283329}
33293330
@@ -3610,15 +3611,15 @@ SyncDataDirectory(void)
36103611/* Sync the top level pgdata directory. */
36113612do_syncfs ("." );
36123613/* If any tablespaces are configured, sync each of those. */
3613- dir = AllocateDir ("pg_tblspc" );
3614- while ((de = ReadDirExtended (dir ,"pg_tblspc" ,LOG )))
3614+ dir = AllocateDir (PG_TBLSPC_DIR );
3615+ while ((de = ReadDirExtended (dir ,PG_TBLSPC_DIR ,LOG )))
36153616{
36163617char path [MAXPGPATH ];
36173618
36183619if (strcmp (de -> d_name ,"." )== 0 || strcmp (de -> d_name ,".." )== 0 )
36193620continue ;
36203621
3621- snprintf (path ,MAXPGPATH ,"pg_tblspc /%s" ,de -> d_name );
3622+ snprintf (path ,MAXPGPATH ,"%s /%s" , PG_TBLSPC_DIR ,de -> d_name );
36223623do_syncfs (path );
36233624}
36243625FreeDir (dir );
@@ -3641,7 +3642,7 @@ SyncDataDirectory(void)
36413642walkdir ("." ,pre_sync_fname , false,DEBUG1 );
36423643if (xlog_is_symlink )
36433644walkdir ("pg_wal" ,pre_sync_fname , false,DEBUG1 );
3644- walkdir ("pg_tblspc" ,pre_sync_fname , true,DEBUG1 );
3645+ walkdir (PG_TBLSPC_DIR ,pre_sync_fname , true,DEBUG1 );
36453646#endif
36463647
36473648/* Prepare to report progress syncing the data directory via fsync. */
@@ -3659,7 +3660,7 @@ SyncDataDirectory(void)
36593660walkdir ("." ,datadir_fsync_fname , false,LOG );
36603661if (xlog_is_symlink )
36613662walkdir ("pg_wal" ,datadir_fsync_fname , false,LOG );
3662- walkdir ("pg_tblspc" ,datadir_fsync_fname , true,LOG );
3663+ walkdir (PG_TBLSPC_DIR ,datadir_fsync_fname , true,LOG );
36633664}
36643665
36653666/*