Re: [PATCH] Relocation of tablespaces in pg_basebackup

From: Steeve Lennmark <steevel(at)handeldsbanken(dot)se>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Relocation of tablespaces in pg_basebackup
Date: 2014-01-15 20:23:35
Message-ID: CADAK8w5COHPzgx53sqs2qej_xHsdfLbJe7NjLquk6U9NeNpafQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 13, 2014 at 6:13 AM, Steeve Lennmark
<steevel(at)handeldsbanken(dot)se>wrote:

> On Mon, Jan 13, 2014 at 4:29 AM, Andreas Karlsson <andreas(at)proxel(dot)se>wrote:
>
>> On 01/09/2014 10:10 PM, Steeve Lennmark wrote:
>>
>>> That's a much better solution, I attached a patch with the updated code.
>>>
>>> # SELECT oid, pg_tablespace_location(oid) FROM pg_tablespace;
>>> [...]
>>> 16388 | /tmp/tblspc1
>>> 16389 | /tmp/tblspc2
>>>
>>> $ pg_basebackup -Xs -D backup/data -T /tmp/tblspc1:$(pwd)/backup/t1 -T
>>> /tmp/tblspc2:$(pwd)/backup/t2
>>>
>>> This produces the following now:
>>> $ ls backup/; ls -l backup/data/pg_tblspc/
>>> data t1 t2
>>> lrwxrwxrwx 1 steevel users 23 Jan 9 20:41 16388 ->
>>> /home/steevel/backup/t1
>>> lrwxrwxrwx 1 steevel users 23 Jan 9 20:41 16389 ->
>>> /home/steevel/backup/t2
>>>
>>
>> Looked at the patch quickly and noticed that it does not support paths
>> containing colons. Is that an acceptable limitation? The $PATH variable in
>> most UNIX shells does not support paths with colons either so such naming
>> of directories is already discouraged.
>>
>
> I thought of this too and wrote a patch for that yesterday, I've
> attached an updated version which supports passing in a path with
> escaped colons.
>

Seems I forgot to change the sgml after the syntax change, here's an
updated patch.

--
Steeve Lennmark

Attachment Content-Type Size
0004-pg_basebackup-relocate-tablespace.patch application/octet-stream 8.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2014-01-15 20:35:21 Re: Why conf.d should be default, and auto.conf and recovery.conf should be in it
Previous Message Josh Berkus 2014-01-15 20:01:56 Re: Why conf.d should be default, and auto.conf and recovery.conf should be in it