Search Postgresql Archives

Backup and Restore BDR databases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux