option -T in pg_basebackup doesn't work on windows

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: option -T in pg_basebackup doesn't work on windows
Date: 2014-07-18 05:45:13
Message-ID: CAA4eK1LgjvsB7cj09LTD5ZEPQS7T48CJWt7w_BZ0kNvg5pFm4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

During my recent work on pg_basebackup, I noticed that
-T option doesn't seem to work on Windows.
The reason for the same is that while updating symlinks
it doesn't consider that on Windows, junction points can
be directories due to which it is not able to update the
symlink location.
Fix is to make the code work like symlink removal code
in destroy_tablespace_directories. Attached patch fixes
problem.

Steps to reproduce problem
------------------------------------------
1. Start server and connect psql client
2. Create Tablespace tbs location 'C:\database\tbs';
3. pg_basebackup.exe -D C:\Data -Fp -x -T C:\database\tbs=C:\database\tbs1

pg_basebackup: could not remove symbolic link "C:\Data/pg_tblspc/16390":
Permission denied

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
pg_basebackup_relocate_tablespace_v1.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Воронин Дмитрий 2014-07-18 06:12:32 Re: New functions in sslinfo module
Previous Message Noah Misch 2014-07-18 05:26:25 Re: Portability issues in TAP tests