Re: option -T in pg_basebackup doesn't work on windows

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)com>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: option -T in pg_basebackup doesn't work on windows
Date: 2014-08-13 15:50:58
Message-ID: 6B333FCCAB5046FB9FC0C935AD61EB8B@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)com>
> 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.

I could reproduce the problem on my Windows machine.

The code change appears correct, but the patch application failed against
the latest source code. I don't know why. Could you confirm this?

patching file src/bin/pg_basebackup/pg_basebackup.c
Hunk #1 FAILED at 1119.
1 out of 1 hunk FAILED -- saving rejects to file
src/bin/pg_basebackup/pg_basebackup.c.rej

On the following line, I think %d must be %u, because Oid is an unsigned
integer.

char *linkloc = psprintf("%s/pg_tblspc/%d", basedir, oid);

Regards
MauMau

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-08-13 15:52:22 Re: failures on barnacle (CLOBBER_CACHE_RECURSIVELY) because of memory leaks
Previous Message Kevin Grittner 2014-08-13 14:55:07 Re: strncpy is not a safe version of strcpy