Re: backup database by cloning itself

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: backup database by cloning itself
Дата
Msg-id 3976.1171478476@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: backup database by cloning itself  (Scott Marlowe <smarlowe@g2switchworks.com>)
Ответы Re: backup database by cloning itself  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-general
Scott Marlowe <smarlowe@g2switchworks.com> writes:
> On Tue, 2007-02-13 at 07:54, filippo wrote:
>> my database is not very big so I want to adopt this backup strategy:
>> I want to clone my database every 1 hour  to another
>> database 'currenttime_mydatabase' in order to have 24 backup a day,
>> overwriting the yesterday backups by today-same-time backups.
>> Can I use
>> CREATE DATABASE my_backup_database TEMPLATE current_database?

> Create database ain't gonna work, cause it needs a database with no
> users connected.

There's a more serious objection, which is that storing a duplicate
database under the same postmaster doesn't give you an independent copy.
If something bad happens to pg_clog or pg_global, *all* your backups may
be rendered useless.

Now if your purpose in making the backups is only to protect against
user errors, and not any sort of hardware failure or Postgres bug,
maybe this isn't an issue.  But it's not what I'd call a backup.

            regards, tom lane

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: backup database by cloning itself
Следующее
От: Wilton Wonrath
Дата:
Сообщение: Protect PL/PGSQL source