Backup and Restore BDR databases

Поиск
Список
Период
Сортировка
От Roland van Laar
Тема Backup and Restore BDR databases
Дата
Msg-id 5640A1E7.8030602@micite.net
обсуждение исходный текст
Список pgsql-general
Hello,

I'm using BDR with master-master replication.  It works like a charm.

I have a question about backups and restoring them.
I use this script to backup my database:
https://wiki.postgresql.org/wiki/Automated_Backup_on_Linux

However I'm getting problems with a pg_restore:

pg_restore -h localhost -U postgres -d exampledb -Fc exampledb.custom

That doesn't work when I restore it a database without bdr.
Restoring it to a bdr database needs a second postgres host because of
the need for DDL locking.

However when using a second postgres host with a bdr enabled database
I'm getting these errors.
For example:
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 195; 1259 17229
SEQUENCE auth_group_id_seq example
pg_restore: [archiver (db)] could not execute query: ERROR:  CREATE
SEQUENCE ... increment is not supported for bdr sequences
     Command was: CREATE SEQUENCE auth_group_id_seq
     START WITH 1500
     INCREMENT BY 1
     MINVALUE 1500
     NO MAXVALUE
     CACHE 1
     U...
pg_restore: [archiver (db)] could not execute query: ERROR: relation
"auth_group_id_seq" does not exist
     Command was: ALTER TABLE auth_group_id_seq OWNER TO exampledb;
<snip>
pg_restore: [archiver (db)] Error from TOC entry 2521; 2604 17440
DEFAULT id exampledb
pg_restore: [archiver (db)] could not execute query: ERROR: relation
"django_migrations_id_seq" does not exist
     Command was: ALTER TABLE ONLY django_migrations ALTER COLUMN id SET
DEFAULT nextval('django_migrations_id_seq'::regclass);


and the restore process hangs.

All the tables are created on both, however there are no rows in them.

My question is, how can I backup and restore a postgres BDR database?

Regards,

Roland van Laar


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [GENERAL] 回复: [GENERAL] ??: postgres cpu 100% need help
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Error when test on DBT2 Postgresql