MCPcopy Create free account
hub / github.com/apache/cloudberry / TempTablespacePath

Function TempTablespacePath

src/backend/storage/file/fd.c:1722–1740  ·  view source on GitHub ↗

* Return the path of the temp directory in a given tablespace. */

Source from the content-addressed store, hash-verified

1720 * Return the path of the temp directory in a given tablespace.
1721 */
1722void
1723TempTablespacePath(char *path, Oid tablespace)
1724{
1725 /*
1726 * Identify the tempfile directory for this tablespace.
1727 *
1728 * If someone tries to specify pg_global, use pg_default instead.
1729 */
1730 if (tablespace == InvalidOid ||
1731 tablespace == DEFAULTTABLESPACE_OID ||
1732 tablespace == GLOBALTABLESPACE_OID)
1733 snprintf(path, MAXPGPATH, "base/%s", PG_TEMP_FILES_DIR);
1734 else
1735 {
1736 /* All other tablespaces are accessed via symlinks */
1737 snprintf(path, MAXPGPATH, "pg_tblspc/%u/%s/%s",
1738 tablespace, GP_TABLESPACE_VERSION_DIRECTORY, PG_TEMP_FILES_DIR);
1739 }
1740}
1741
1742/*
1743 * Open a temporary file in a specific tablespace.

Callers 4

pg_ls_tmpdirFunction · 0.85
SharedFileSetCreateFunction · 0.85
SharedFileSetPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected