Re: Backup & Restore

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: Backup & Restore
Дата
Msg-id m33czp1tz3.fsf@varsoon.denali.to
обсуждение исходный текст
Ответ на Backup & Restore  (Marcelo Pereira <gandalf@sum.desktop.com.br>)
Список pgsql-general
Marcelo Pereira <gandalf@sum.desktop.com.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: template Database
Следующее
От: Doug McNaught
Дата:
Сообщение: Re: help with getting index scan