|
37 | 37 | * |
38 | 38 | * |
39 | 39 | * IDENTIFICATION |
40 | | - * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.17 2005/04/14 20:03:24 tgl Exp $ |
| 40 | + * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.18 2005/05/02 18:26:53 momjian Exp $ |
41 | 41 | * |
42 | 42 | *------------------------------------------------------------------------- |
43 | 43 | */ |
@@ -341,8 +341,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt) |
341 | 341 | /* |
342 | 342 | * All seems well, create the symlink |
343 | 343 | */ |
344 | | -linkloc= (char*)palloc(strlen(DataDir)+11+10+1); |
345 | | -sprintf(linkloc,"%s/pg_tblspc/%u",DataDir,tablespaceoid); |
| 344 | +linkloc=GetTablespacePath(tablespaceoid); |
346 | 345 |
|
347 | 346 | if (symlink(location,linkloc)<0) |
348 | 347 | ereport(ERROR, |
@@ -495,8 +494,7 @@ remove_tablespace_directories(Oid tablespaceoid, bool redo) |
495 | 494 | char*subfile; |
496 | 495 | structstatst; |
497 | 496 |
|
498 | | -location= (char*)palloc(strlen(DataDir)+11+10+1); |
499 | | -sprintf(location,"%s/pg_tblspc/%u",DataDir,tablespaceoid); |
| 497 | +location=GetTablespacePath(tablespaceoid); |
500 | 498 |
|
501 | 499 | /* |
502 | 500 | * Check if the tablespace still contains any files. We try to rmdir |
@@ -1036,8 +1034,7 @@ tblspc_redo(XLogRecPtr lsn, XLogRecord *record) |
1036 | 1034 | set_short_version(location); |
1037 | 1035 |
|
1038 | 1036 | /* Create the symlink if not already present */ |
1039 | | -linkloc= (char*)palloc(strlen(DataDir)+11+10+1); |
1040 | | -sprintf(linkloc,"%s/pg_tblspc/%u",DataDir,xlrec->ts_id); |
| 1037 | +linkloc=GetTablespacePath(xlrec->ts_id); |
1041 | 1038 |
|
1042 | 1039 | if (symlink(location,linkloc)<0) |
1043 | 1040 | { |
|