Re: [PATCH] Relocation of tablespaces in pg_basebackup
От | Magnus Hagander |
---|---|
Тема | Re: [PATCH] Relocation of tablespaces in pg_basebackup |
Дата | |
Msg-id | CABUevExbDEUmNM6nttL8kiE14Y_uLPt=yBBZDRUK+oOCAcpH4A@mail.gmail.com обсуждение исходный текст |
Ответ на | [PATCH] Relocation of tablespaces in pg_basebackup (Steeve Lennmark <steevel@handeldsbanken.se>) |
Ответы |
Re: [PATCH] Relocation of tablespaces in pg_basebackup
|
Список | pgsql-hackers |
On Thu, Jan 9, 2014 at 6:58 PM, Steeve Lennmark <steevel@handeldsbanken.se> wrote:
Currently pg_basebackup is pretty invasive when using tablespaces, atleast using the plain format. This since it requires the tablespace tobe written to the same location as on the server beeing backed up. Thisboth breaks backing up locally using -Fp (since the tablespace wouldbe written to the same location) and requires the backup user to havewrite permissions in locations it shouldn't need to have access to.
Yeah, this has been sitting on my TODO for a long time :) Glad to see someone is picking it up.
This patch adds the ability to relocate tablespaces by adding thecommand line argument --tablespace (-T) which takes a required argumentin the format "oid:tablespacedir". After all tablespaces are fetchedthis code updates the symlink to point to the new tablespace location.I would have loved to be able to pass tablespacename:tablespacedirthough, but sadly I wasn't able to figure out how to retrieve thatinformation without creating another connection to the database.
You could also use the format "olddir:newdir", because you do know that. It's not the name of the tablespace. but I think it's still more usefriendly than using the oid.
This feature might be missing because of some other limitation I failto see, if so let me know. Please be gentle, this is my first patch ;-)
В списке pgsql-hackers по дате отправления: