pgsql: Change the way pg_basebackup's tablespace mapping is implemented

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change the way pg_basebackup's tablespace mapping is implemented
Date: 2014-08-22 07:30:53
Message-ID: E1XKjJF-0007iv-HL@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Change the way pg_basebackup's tablespace mapping is implemented.

Previously, we would first create the symlinks the way they are in the
original system, and at the end replace them with the mapped symlinks.
That never really made much sense, so now we create the symlink pointing
to the correct location to begin with, so that there's no need to fix
them at the end.

The old coding didn't work correctly on Windows, because Windows junction
points look more like directories than files, and ought to be removed with
rmdir rather than unlink. Also, it incorrectly used "%d" rather than "%u"
to print an Oid, but that's gone now.

Report and patch by Amit Kapila, with minor changes by me. Reviewed by
MauMau. Backpatch to 9.4, where the --tablespace feature was added.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/8a22633f52f2399118d6ad3c2c4da6a31f07e907

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c | 64 +++++++++++----------------------
1 file changed, 20 insertions(+), 44 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-08-22 10:48:30 pgsql: Fix comment in pg_basebackup.
Previous Message Peter Eisentraut 2014-08-22 01:38:20 pgsql: Fix whitespace