From: Frank Finner <postgresql@finner.de>
To: arun kv <arun@library.iisc.ernet.in>
Cc: PGSQL <pgsql-php@postgresql.org>
Subject: Re: backup postgres database
Date: Wed, 13 Mar 2002 19:51:07 +0100 (CET)
Message-ID: <XFMail.020313195107.postgresql@finner.de> (raw)
In-Reply-To: <Pine.BSO.4.21.0203131936110.25120-100000@library.iisc.ernet.in>
Hi,
pg_dump and psql are your friends.
Dump the database with pg_dump, take the file and insert it into psql
on the other machine. Details are covered in the manpages of these
programs.
Crude (without options): pg_dump your_db > your_db.dump
psql < your_db.dump
In the manpages you also find the options to dump with all create
statements (e.g. CREATE DATABASE on the new machine) you might need.
pg_dump is also THE solution to make backups. If you simply take the
database files (especially, if the engine is running), you probably
cannot use them either for backup or for transferring due to caching
and other things. With pg_dump you even can transfer your database to
another database engine (from PostgreSQL to Oracle for example), if you
dump it with the option of complete insert statements.
mfg frank finner
On 13-Mar-02 arun kv sat down, thought for a long time and then wrote:
> hello sir,
> i have a postgresql database in one system and want to
> transfer
> the same to another system. i am not finding a way to transfer this
> database from one system to another.if i transfer the file in
> /var/lib/pgsql/libdatabase them it gives error.how shall i transfer
> database.
> another thing. how to take up backups of the database on the
> system.
> pls help me as i am new to postgresql
> thanking you
> Arun
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Frank Finner
And now there is no turning back at all.
(M. Moorcock, "Elric Of Melnibone")"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: postgresql@finner.de, arun@library.iisc.ernet.in
Subject: Re: backup postgres database
In-Reply-To: <XFMail.020313195107.postgresql@finner.de>
References: <Pine.BSO.4.21.0203131936110.25120-100000@library.iisc.ernet.in> <XFMail.020313195107.postgresql@finner.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox