mirror of
https://github.com/postgres/postgres.git
synced 2025-05-20 00:03:14 -04:00
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.
This commit is contained in:
parent
0a971e2f20
commit
2154e1c11e
@ -37,7 +37,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.32 2006/03/24 04:32:13 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.33 2006/03/29 15:15:43 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -81,9 +81,6 @@ static void set_short_version(const char *path);
|
|||||||
* object in the tablespace, create the subdirectory. If the subdirectory
|
* object in the tablespace, create the subdirectory. If the subdirectory
|
||||||
* already exists, just fall through quietly.
|
* 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.
|
* isRedo indicates that we are creating an object during WAL replay.
|
||||||
* In this case we will cope with the possibility of the tablespace
|
* In this case we will cope with the possibility of the tablespace
|
||||||
* directory not being there either --- this could happen if we are
|
* directory not being there either --- this could happen if we are
|
||||||
@ -91,11 +88,14 @@ static void set_short_version(const char *path);
|
|||||||
* We handle this by making a directory in the place where the tablespace
|
* 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
|
* symlink would normally be. This isn't an exact replay of course, but
|
||||||
* it's the best we can do given the available information.
|
* 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
|
void
|
||||||
TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
|
TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SYMLINK
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char *dir;
|
char *dir;
|
||||||
|
|
||||||
@ -178,7 +178,6 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pfree(dir);
|
pfree(dir);
|
||||||
#endif /* HAVE_SYMLINK */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user