Re: Backup & Restore

From: Doug McNaught <doug(at)wireboard(dot)com>
To: Marcelo Pereira <gandalf(at)sum(dot)desktop(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Backup & Restore
Date: 2002-02-25 15:06:40
Message-ID: m33czp1tz3.fsf@varsoon.denali.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marcelo Pereira <gandalf(at)sum(dot)desktop(dot)com(dot)br> writes:

> Hello All,
>
> Which is the simplest way to do a backup? My db is really small (about
> 4Mb), so I would like to make a backup to each day, save it in separated
> files, and restore it if necessary.
>
> So, which is the usual way to create the backup files? And how can I
> restore these backups?

The simplest way is to run pg_dump from a cron job and redirect the
output to a file. You can name the file whatever you want. The
output of pg_dump is SQL that will create and populate your database.

To restore, feed the dump file to 'psql'.

Note that if you're using large objects it gets a little more
complicated and you have to use 'pg_restore' rather than 'psql' for
restores.

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863

In response to

Browse pgsql-general by date

  From Date Subject
Next Message tony 2002-02-25 15:07:37 some pgaccess questions
Previous Message Stephan Szabo 2002-02-25 15:06:03 Re: About functions