Re: PG_RESTORE/DUMP Question - Mailing list pgsql-general

From Doug McNaught
Subject Re: PG_RESTORE/DUMP Question
Date
Msg-id m33cdcp2gk.fsf@varsoon.wireboard.com
Whole thread Raw
In response to PG_RESTORE/DUMP Question  (Alex <alex@meerkatsoft.com>)
List pgsql-general
Alex <alex@meerkatsoft.com> writes:

> Hi,
>
> I have a test system that is setup the same as a production system and
> would like to frequently copy the database over.
> pg_dump takes a few hours and even sometimes hangs.
>
> Are there any reasons not to simply just copy the entire data
> directory over to the test system? I could not find any postings on
> the net suggesting otherwise. Is there anything to pay attention too ?

If the two systems are the same architecture and OS, this can work,
but in order to get a consistent copy, you need to either:

a) Stop (completely shut down) the source database while the copy
runs, or
b) Use volume management and take a snapshot of the source database,
them copy the snapshot over.  This will lose open transactions but
will be otherwise consistent.

-Doug

pgsql-general by date:

Previous
From: Alex
Date:
Subject: PG_RESTORE/DUMP Question
Next
From: Shridhar Daithankar
Date:
Subject: Re: PG_RESTORE/DUMP Question