On Thu, May 14, 2015 at 2:10 AM, Andrew Dunstan <
andrew@dunslane.net> wrote:
>
> How about if we simply abort if we find a non-symlink where we want the symlink to be, and only remove something that is actually a symlink (or a junction point, which is more or less the same thing)?
>
We can do that way and for that I think we need to use rmdir
instead of rmtree in the code being discussed (recovery path),
OTOH we should try to minimize the errors raised during
recovery.
> Then it would be up to the user to recover the situation, by moving or removing the offending file/directory, and trying again.
>
Yes, I think as we only create/maintain symlinks in pg_tblspc
for tablespaces, so it seems okay even if we error out when we
find directories instead of symlinks in that path.
I can write a patch for this if you, Heikki and or others think that
is the better way to deal with this case.