aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/misc.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2005-05-10 22:27:30 +0000
committerBruce Momjian <bruce@momjian.us>2005-05-10 22:27:30 +0000
commit35e16515080868e87849a6846ab1c36977157154 (patch)
treee6666df41d9dd86b5978c4b4072967c55347abe2 /src/backend/utils/adt/misc.c
parent075ec42cf889598effc8f8a0f5c661f2e7408b61 (diff)
downloadpostgresql-35e16515080868e87849a6846ab1c36977157154.tar.gz
postgresql-35e16515080868e87849a6846ab1c36977157154.zip
Back out check for unreferenced files.
Heikki Linnakangas
Diffstat (limited to 'src/backend/utils/adt/misc.c')
-rw-r--r--src/backend/utils/adt/misc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c
index 68586bba7ef..2b1c5e7406f 100644
--- a/src/backend/utils/adt/misc.c
+++ b/src/backend/utils/adt/misc.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.41 2005/05/02 18:26:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.42 2005/05/10 22:27:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,7 +26,6 @@
#include "funcapi.h"
#include "catalog/pg_type.h"
#include "catalog/pg_tablespace.h"
-#include "catalog/catalog.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
@@ -145,6 +144,11 @@ pg_tablespace_databases(PG_FUNCTION_ARGS)
fctx = palloc(sizeof(ts_db_fctx));
+ /*
+ * size = path length + tablespace dirname length + 2 dir sep
+ * chars + oid + terminator
+ */
+ fctx->location = (char *) palloc(strlen(DataDir) + 11 + 10 + 1);
if (tablespaceOid == GLOBALTABLESPACE_OID)
{
fctx->dirdesc = NULL;
@@ -153,7 +157,12 @@ pg_tablespace_databases(PG_FUNCTION_ARGS)
}
else
{
- fctx->location = GetTablespacePath(tablespaceOid);
+ if (tablespaceOid == DEFAULTTABLESPACE_OID)
+ sprintf(fctx->location, "%s/base", DataDir);
+ else
+ sprintf(fctx->location, "%s/pg_tblspc/%u", DataDir,
+ tablespaceOid);
+
fctx->dirdesc = AllocateDir(fctx->location);
if (!fctx->dirdesc)