Re: tablespace restore

From: Vangelis Katsikaros <ibob17(at)yahoo(dot)gr>
To: Matthew Walden <matthew(dot)walden(at)bcs(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tablespace restore
Date: 2010-11-19 13:30:13
Message-ID: 4CE67BE5.40903@yahoo.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/19/2010 03:12 PM, Matthew Walden wrote:
> Vangelis,
>
> I don't believe you can do file level copying of single databases
> (especially as they are different versions).

Hi Matthew, thanks for your answer.

If the different versions is a problem, I can downgrade one server and
then upgrade afterwards.

> Take a look at pg_dump in the documentation. This will do what you need I
> think but at a logical level rather than physical.

Hm, from what I understand pg_dump doesn't dump indexes (ie the indexing
information - not an SQL clause in CREATE TABLE). Also I have lots of
Giga of data, so I imagine that pg_restore will take quite some time to
execute the INSERTs and reindex.

Regards
Vangelis

>
> On Fri, Nov 19, 2010 at 11:52 AM, Vangelis Katsikaros<ibob17(at)yahoo(dot)gr>wrote:
>
>> Hello
>>
>> I use postgres 8.3.12 on machineA and 8.4.5 on machineB.
>>
>> On machineA I have created a tablespace with
>> CREATE TABLESPACE tablelocation_name LOCATION '/my/location/machineA';
>>
>> I then created a database with
>> CREATE DATABASE db_name TABLESPACE tablelocation;
>>
>> I created tables, inserted data and created indexes.
>>
>> I now want to "move" the db from '/my/location/machineA' of machine A to
>> '/other/location/machineB' of machine B. My question is how I can do a
>> filesystem backup/restore (I want to move the indexes too - too time
>> consuming to reindex).
>>
>> Machine B already has a postgres running, and postgres on machine B already
>> has other databases. During this process I have no problem of shutting down
>> postgres.
>>
>>
>> I have tried some things unsuccessfully:
>> 1) - stop postgres on machine B
>> - copy dir of tablelocation of machine A to '/other/location/machineB'
>> on machine B
>> - start postgres on machine B
>> - CREATE TABLESPACE tablelocation_name LOCATION
>> '/other/location/machineB';
>> ERROR: directory "/other/location/machineB" is not empty
>>
>>
>> Regards
>> Vangelis
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Walden 2010-11-19 13:37:07 Re: tablespace restore
Previous Message Elliot Chance 2010-11-19 13:19:56 Forums at postgresql.com.au