aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/misc.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2005-05-02 18:26:54 +0000
committerBruce Momjian <bruce@momjian.us>2005-05-02 18:26:54 +0000
commit76668e6eb468caa6e09af71d6bee820e2dc0fc3c (patch)
tree4d036964b0b551dde801c82db1f78b41ab7a4a77 /src/backend/utils/adt/misc.c
parentb656150ec0b7bab95cb04f4d11ffa46f9fd4118d (diff)
downloadpostgresql-76668e6eb468caa6e09af71d6bee820e2dc0fc3c.tar.gz
postgresql-76668e6eb468caa6e09af71d6bee820e2dc0fc3c.zip
Check the file system on postmaster startup and report any unreferenced
files in the server log. Heikki Linnakangas
Diffstat (limited to 'src/backend/utils/adt/misc.c')
-rw-r--r--src/backend/utils/adt/misc.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c
index 29ddf035350..68586bba7ef 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.40 2004/12/31 22:01:22 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.41 2005/05/02 18:26:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,6 +26,7 @@
#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))
@@ -144,11 +145,6 @@ 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;
@@ -157,12 +153,7 @@ pg_tablespace_databases(PG_FUNCTION_ARGS)
}
else
{
- if (tablespaceOid == DEFAULTTABLESPACE_OID)
- sprintf(fctx->location, "%s/base", DataDir);
- else
- sprintf(fctx->location, "%s/pg_tblspc/%u", DataDir,
- tablespaceOid);
-
+ fctx->location = GetTablespacePath(tablespaceOid);
fctx->dirdesc = AllocateDir(fctx->location);
if (!fctx->dirdesc)