From 8f15f74a44f68f9cb3a644786d3c732a5eeb237a Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 26 Jun 2015 15:53:13 -0400 Subject: Be more conservative about removing tablespace "symlinks". Don't apply rmtree(), which will gleefully remove an entire subtree, and don't even apply unlink() unless it's symlink or a directory, the only things that we expect to find. Amit Kapila, with minor tweaks by me, per extensive discussions involving Andrew Dunstan, Fujii Masao, and Heikki Linnakangas, at least some of whom also reviewed the code. --- src/include/commands/tablespace.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/commands') diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h index 86b0477335b..6b928a58a01 100644 --- a/src/include/commands/tablespace.h +++ b/src/include/commands/tablespace.h @@ -56,6 +56,7 @@ extern Oid get_tablespace_oid(const char *tablespacename, bool missing_ok); extern char *get_tablespace_name(Oid spc_oid); extern bool directory_is_empty(const char *path); +extern void remove_tablespace_symlink(const char *linkloc); extern void tblspc_redo(XLogReaderState *rptr); extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr); -- cgit v1.2.3