Re: Working with one live and one development database

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: hugo(dot)wetterberg(at)gmail(dot)com
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Working with one live and one development database
Date: 2006-12-05 17:15:38
Message-ID: 1165338938.14565.447.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2006-12-05 at 04:59, hugo(dot)wetterberg(at)gmail(dot)com wrote:
> Hi all,
> We are moving from MySQL to PgSQL in my organization and I would like
> some input on what the best method is for working with one development
> and one live database. We need to copy all data, structure information,
> functions et.c. from the live database to the development database
> every now and then. The development database will be on a separate
> machine. What is the best way to do this?

I do this quite often for testing purposes. If the dbs are on different
machines, then, from a place that can connect to both machines,
something like:

// if the slave_server db exists:
dropdb -h slave_server -U superuser dbname
createdb -h slave_server -U superuser dbname
pg_dump -h master_server -U superuser dbname | psql -h slave_server -U
superuser dbname

In response to

Browse pgsql-general by date

  From Date Subject
Next Message andy rost 2006-12-05 17:36:38 Unable to restart postgres - database system was interrupted
Previous Message Raymond O'Donnell 2006-12-05 17:09:51 Re: Working with one live and one development database