diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-08-29 21:08:48 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-08-29 21:08:48 +0000 |
commit | 50742aed68b7a3a8d1a0c8ef8d970c97fc74dd9b (patch) | |
tree | c60891419eb5cb4e2c73296f973d91bba13f9e03 /src/port/path.c | |
parent | ee66401f3176e32c884ce98c09c8383cfa453dbc (diff) | |
download | postgresql-50742aed68b7a3a8d1a0c8ef8d970c97fc74dd9b.tar.gz postgresql-50742aed68b7a3a8d1a0c8ef8d970c97fc74dd9b.zip |
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.
Diffstat (limited to 'src/port/path.c')
-rw-r--r-- | src/port/path.c | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/src/port/path.c b/src/port/path.c index dae4eeab099..8017417b708 100644 --- a/src/port/path.c +++ b/src/port/path.c @@ -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 @@ -374,27 +407,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/ */ static void |