PG Database backup/foreign-key constraints

696 views
Skip to first unread message

Paullo

unread,
Jun 24, 2016, 12:10:07 PM6/24/16
to Mezzanine Users
Hi,

I'm trying to make a backup of a Mezzanine site database before attempting an upgrade but get this error from pg_dump:

(I've tried using all formats; tar, custom, directory, sql)

pg_dump: NOTICE: there are circular foreign-key constraints among these table(s):
pg_dump:   pages_page
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: NOTICE: there are circular foreign-key constraints among these table(s):
pg_dump:   generic_threadedcomment
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.


I know this isn't strictly a Mezzanine issue but google-fu just shows lots of convoluted faffing with temporary tables for the restore, etc and others stating that pg_dump with a binary format will never have this issue....I'm feeling like there must be an easy way to take a full backup/clone of a database but after many hours I just can see it.

Can anyone here help with this?

Paul

Eduardo Rivas

unread,
Jun 24, 2016, 12:14:01 PM6/24/16
to mezzani...@googlegroups.com
Weird, I've never had any trouble dumping/restoring a Mezzanine DB with
Postgres.

These are the commands I use:
https://gist.github.com/jerivas/a2f321bb8fa4d305a481#postgres-exportimport-without-the-postgres-user

At any rate, you may need to wipe the target database before a restore,
but that should be it.
Reply all
Reply to author
Forward
0 new messages