* Return the path of the temp directory in a given tablespace. */
| 1720 | * Return the path of the temp directory in a given tablespace. |
| 1721 | */ |
| 1722 | void |
| 1723 | TempTablespacePath(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. |
no outgoing calls
no test coverage detected