Re: backup postgres database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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")"


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux