Backup and Restore BDR databases

From: Roland van Laar <roland(at)micite(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Backup and Restore BDR databases
Date: 2015-11-09 13:38:47
Message-ID: 5640A1E7.8030602@micite.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-11-09 15:54:31 Re: Error when test on DBT2 Postgresql
Previous Message Pavel Stehule 2015-11-09 11:03:46 Re: [GENERAL] 回复: [GENERAL] ??: postgres cpu 100% need help