mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Back out check for unreferenced files.
Heikki Linnakangas
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user