summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-03-29 15:16:00 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-03-29 15:16:00 +0000
commit1750f60ef3e730faf72ecfa7fbd7ee6ad799f293 (patch)
tree2b233be63777e18445149f067f2217ed4df25a93
parentb5c5c5d2838d2a9e80e58000138c50ed0aa0eff0 (diff)
TablespaceCreateDbspace should function normally even on platforms that do not
have symlinks (ie, Windows). Although it'll never be called on to do anything useful during normal operation on such a platform, it's still needed to re-create dropped directories during WAL replay.
-rw-r--r--src/backend/commands/tablespace.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index de051399ebc..32becc1efe6 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.15.4.1 2006/01/19 04:45:57 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.15.4.2 2006/03/29 15:16:00 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -80,9 +80,6 @@ static void set_short_version(const char *path);
* object in the tablespace, create the subdirectory. If the subdirectory
* already exists, just fall through quietly.
*
- * If tablespaces are not supported, this is just a no-op; CREATE DATABASE
- * is expected to create the default subdirectory for the database.
- *
* isRedo indicates that we are creating an object during WAL replay.
* In this case we will cope with the possibility of the tablespace
* directory not being there either --- this could happen if we are
@@ -90,11 +87,14 @@ static void set_short_version(const char *path);
* We handle this by making a directory in the place where the tablespace
* symlink would normally be. This isn't an exact replay of course, but
* it's the best we can do given the available information.
+ *
+ * If tablespaces are not supported, you might think this could be a no-op,
+ * but you'd be wrong: we still need it in case we have to re-create a
+ * database subdirectory (of $PGDATA/base) during WAL replay.
*/
void
TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
{
-#ifdef HAVE_SYMLINK
struct stat st;
char *dir;
@@ -177,7 +177,6 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
}
pfree(dir);
-#endif /* HAVE_SYMLINK */
}
/*