1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Add WAL logging for CREATE/DROP DATABASE and CREATE/DROP TABLESPACE.

Fix TablespaceCreateDbspace() to be able to create a dummy directory
in place of a dropped tablespace's symlink.  This eliminates the open
problem of a PANIC during WAL replay when a replayed action attempts
to touch a file in a since-deleted tablespace.  It also makes for a
significant improvement in the usability of PITR replay.
This commit is contained in:
Tom Lane
2004-08-29 21:08:48 +00:00
parent ee66401f31
commit 50742aed68
9 changed files with 483 additions and 106 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/path.c,v 1.33 2004/08/29 05:07:02 momjian Exp $
* $PostgreSQL: pgsql/src/port/path.c,v 1.34 2004/08/29 21:08:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -324,6 +324,39 @@ get_locale_path(const char *my_exec_path, char *ret_path)
}
/*
* get_home_path
*/
bool
get_home_path(char *ret_path)
{
if (getenv(HOMEDIR) == NULL)
{
*ret_path = '\0';
return false;
}
else
{
StrNCpy(ret_path, getenv(HOMEDIR), MAXPGPATH);
canonicalize_path(ret_path);
return true;
}
}
/*
* get_parent_directory
*
* Modify the given string in-place to name the parent directory of the
* named file.
*/
void
get_parent_directory(char *path)
{
trim_directory(path);
trim_trailing_separator(path);
}
/*
* set_pglocale_pgservice
@ -373,27 +406,6 @@ set_pglocale_pgservice(const char *argv0, const char *app)
}
/*
* get_include_path
*/
bool
get_home_path(char *ret_path)
{
if (getenv(HOMEDIR) == NULL)
{
*ret_path = '\0';
return false;
}
else
{
StrNCpy(ret_path, getenv(HOMEDIR), MAXPGPATH);
canonicalize_path(ret_path);
return true;
}
}
/*
* make_relative - adjust path to be relative to bin/
*/