diff options
author | Bruce Momjian <bruce@momjian.us> | 2010-01-12 02:42:52 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2010-01-12 02:42:52 +0000 |
commit | 228170410dd407f266e777dd49916aff0b1b5936 (patch) | |
tree | f29f53537d487ca646538ab2c7e4d8f0bfe6ea71 /src/backend/utils/adt/misc.c | |
parent | 894fc6b763c2053c01a5be5d20a76d1db650547d (diff) |
Please tablespace directories in their own subdirectory so pg_migrator
can upgrade clusters without renaming the tablespace directories. New
directory structure format is, e.g.:
$PGDATA/pg_tblspc/20981/PG_8.5_201001061/719849/83292814
Diffstat (limited to 'src/backend/utils/adt/misc.c')
-rw-r--r-- | src/backend/utils/adt/misc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c index 4d79b369634..ba7fb1ad674 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.73 2010/01/02 16:57:54 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.74 2010/01/12 02:42:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -20,6 +20,7 @@ #include <math.h> #include "access/xact.h" +#include "catalog/catalog.h" #include "catalog/pg_type.h" #include "catalog/pg_tablespace.h" #include "commands/dbcommands.h" @@ -185,7 +186,8 @@ pg_tablespace_databases(PG_FUNCTION_ARGS) /* * size = tablespace dirname length + dir sep char + oid + terminator */ - fctx->location = (char *) palloc(10 + 10 + 1); + fctx->location = (char *) palloc(9 + 1 + OIDCHARS + 1 + + strlen(TABLESPACE_VERSION_DIRECTORY) + 1); if (tablespaceOid == GLOBALTABLESPACE_OID) { fctx->dirdesc = NULL; @@ -197,7 +199,8 @@ pg_tablespace_databases(PG_FUNCTION_ARGS) if (tablespaceOid == DEFAULTTABLESPACE_OID) sprintf(fctx->location, "base"); else - sprintf(fctx->location, "pg_tblspc/%u", tablespaceOid); + sprintf(fctx->location, "pg_tblspc/%u/%s", tablespaceOid, + TABLESPACE_VERSION_DIRECTORY); fctx->dirdesc = AllocateDir(fctx->location); |