Re: [GENERAL] Copy a database.

From: Tom Ivar Helbekkmo <tih(at)nhh(dot)no>
To: manik(at)post1(dot)com
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Copy a database.
Date: 1999-02-23 10:07:19
Message-ID: 86yalpph60.fsf@athene.nhh.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Manik Surtani <manik(at)post1(dot)com> writes:

> I currently have a whole bunch of records in a database on one machine.
> I want to copy it all to an identical postgres setup on another
> machine. I have already created all the necessary tables, with
> identical structures. i just want to copy the records across.

On the "old" machine:

% pg_dump -a -D -f mydb.dump mydb

Then move mydb.dump to the new machine, and do:

% psql mydb
mydb=> \i mydb.dump

For more information, see 'man pg_dump'.

-tih
--
Popularity is the hallmark of mediocrity. --Niles Crane, "Frasier"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message K.T. 1999-02-23 10:18:00 Re: [GENERAL] Copy a database.
Previous Message Manik Surtani 1999-02-23 09:55:19 Copy a database.