*** pgsql/src/backend/utils/adt/misc.c 2010/01/02 16:57:54 1.73 --- pgsql/src/backend/utils/adt/misc.c 2010/01/12 02:42:52 1.74 *************** *** 8,14 **** * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.72 2009/07/14 20:24:10 tgl Exp $ * *------------------------------------------------------------------------- */ --- 8,14 ---- * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.73 2010/01/02 16:57:54 momjian Exp $ * *------------------------------------------------------------------------- */ *************** *** 20,25 **** --- 20,26 ---- #include #include "access/xact.h" + #include "catalog/catalog.h" #include "catalog/pg_type.h" #include "catalog/pg_tablespace.h" #include "commands/dbcommands.h" *************** pg_tablespace_databases(PG_FUNCTION_ARGS *** 185,191 **** /* * size = tablespace dirname length + dir sep char + oid + terminator */ ! fctx->location = (char *) palloc(10 + 10 + 1); if (tablespaceOid == GLOBALTABLESPACE_OID) { fctx->dirdesc = NULL; --- 186,193 ---- /* * size = tablespace dirname length + dir sep char + oid + terminator */ ! fctx->location = (char *) palloc(9 + 1 + OIDCHARS + 1 + ! strlen(TABLESPACE_VERSION_DIRECTORY) + 1); if (tablespaceOid == GLOBALTABLESPACE_OID) { fctx->dirdesc = NULL; *************** pg_tablespace_databases(PG_FUNCTION_ARGS *** 197,203 **** if (tablespaceOid == DEFAULTTABLESPACE_OID) sprintf(fctx->location, "base"); else ! sprintf(fctx->location, "pg_tblspc/%u", tablespaceOid); fctx->dirdesc = AllocateDir(fctx->location); --- 199,206 ---- if (tablespaceOid == DEFAULTTABLESPACE_OID) sprintf(fctx->location, "base"); else ! sprintf(fctx->location, "pg_tblspc/%u/%s", tablespaceOid, ! TABLESPACE_VERSION_DIRECTORY); fctx->dirdesc = AllocateDir(fctx->location);