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

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, MauMau <maumau307(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-22 07:30:50
Message-ID: 53F6F1AA.2090905@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08/22/2014 07:08 AM, Amit Kapila wrote:
> On Thu, Aug 21, 2014 at 3:44 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
>>
>> On Tue, Aug 19, 2014 at 9:51 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
>>> On Mon, Aug 18, 2014 at 7:50 PM, Heikki Linnakangas <
> hlinnakangas(at)vmware(dot)com> wrote:
>>>> Wouldn't it make a lot more sense to create it correctly in the first
> place?
>>>
>>> Looking at the code, I think it is very well possible to create
>>> it correctly in the first place without much extra work. I will
>>> send a patch if nobody sees any problem with this change.
>>
>> Attached patch implements the above suggested fix.
>> I have removed the earlier code which was used to update the
>> symlink path.
>
> Today morning, I realised that there is one problem with the
> patch I sent yesterday and the problem is that incase user
> has not given -T option, it will not be able to create the symlink
> for appropriate path. Attached patch fix this issue.

Thanks, committed with minor changes:

* fixed the error message to print the mapped path that it actually
tried to create, instead of the original.
* there's no need to copy the mapped path string, so I just used a pointer
* made the code to do the basetablespace mapping in top of the function
a little bit tidier (IMHO anyway), although it wasn't really this patch's.
* I noticed that the mappings now apply to any symlinks in the data
directory. I think that's OK, we don't expect there to be any other
symlinks, especially not pointing to a tablespace location, but if there
are, it's arguably a good thing that they are mapped too.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Szymon Guz 2014-08-22 07:32:37 potential bug in psql
Previous Message Andrew Gierth 2014-08-22 07:18:13 Re: WIP Patch for GROUPING SETS phase 1