On Thu, May 11, 2017 at 1:09 PM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:
> If we can accept multiple server versions share a tablespace
> directory, pg_basebackup also can allow that situation. The
> attached patch does that. Similary to the server code, it
> correctly fails if the same version subdirectory exists.
+#define verify_dir_is_empty_or_create(dirname, created, found) \
+ verify_and_create_dir(dirname, created, found, false)
This solution looks like a quick-and-dirty fix. I tend to prefer a
solution close to whet Pierre is proposing on the other thread by
localizing things in ReceiveAndUnpackTarFile(). This makes the check
more localized, and there is no need to complicate low-level APIs of
pg_basebackup.c.
By the way, it may be better to keep discussions on the first thread created:
https://www.postgresql.org/message-id/05c62730-8670-4da6-b783-52e66fb42232@pinaraf.info
A patch has been submitted to the next CF there as well.
--
Michael