Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2281704

Browse files
committed
Please tablespace directories in their own subdirectory so pg_migrator
can upgrade clusters without renaming the tablespace directories. Newdirectory structure format is, e.g.:$PGDATA/pg_tblspc/20981/PG_8.5_201001061/719849/83292814
1 parent894fc6b commit2281704

File tree

9 files changed

+189
-184
lines changed

9 files changed

+189
-184
lines changed

‎src/backend/catalog/catalog.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/catalog/catalog.c,v 1.86 2010/01/06 02:41:37 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/catalog/catalog.c,v 1.87 2010/01/12 02:42:51 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -115,16 +115,17 @@ relpath(RelFileNode rnode, ForkNumber forknum)
115115
else
116116
{
117117
/* All other tablespaces are accessed via symlinks */
118-
pathlen=10+OIDCHARS+1+OIDCHARS+1+OIDCHARS+1
119-
+FORKNAMECHARS+1;
118+
pathlen=9+1+OIDCHARS+1+strlen(TABLESPACE_VERSION_DIRECTORY)+
119+
1+OIDCHARS+1+OIDCHARS+1+FORKNAMECHARS+1;
120120
path= (char*)palloc(pathlen);
121121
if (forknum!=MAIN_FORKNUM)
122-
snprintf(path,pathlen,"pg_tblspc/%u/%u/%u_%s",
123-
rnode.spcNode,rnode.dbNode,rnode.relNode,
124-
forkNames[forknum]);
122+
snprintf(path,pathlen,"pg_tblspc/%u/%s/%u/%u_%s",
123+
rnode.spcNode,TABLESPACE_VERSION_DIRECTORY,
124+
rnode.dbNode,rnode.relNode,forkNames[forknum]);
125125
else
126-
snprintf(path,pathlen,"pg_tblspc/%u/%u/%u",
127-
rnode.spcNode,rnode.dbNode,rnode.relNode);
126+
snprintf(path,pathlen,"pg_tblspc/%u/%s/%u/%u",
127+
rnode.spcNode,TABLESPACE_VERSION_DIRECTORY,
128+
rnode.dbNode,rnode.relNode);
128129
}
129130
returnpath;
130131
}
@@ -161,10 +162,11 @@ GetDatabasePath(Oid dbNode, Oid spcNode)
161162
else
162163
{
163164
/* All other tablespaces are accessed via symlinks */
164-
pathlen=10+OIDCHARS+1+OIDCHARS+1;
165+
pathlen=9+1+OIDCHARS+1+strlen(TABLESPACE_VERSION_DIRECTORY)+
166+
1+OIDCHARS+1;
165167
path= (char*)palloc(pathlen);
166-
snprintf(path,pathlen,"pg_tblspc/%u/%u",
167-
spcNode,dbNode);
168+
snprintf(path,pathlen,"pg_tblspc/%u/%s/%u",
169+
spcNode,TABLESPACE_VERSION_DIRECTORY,dbNode);
168170
}
169171
returnpath;
170172
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp