mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user