pg_restore error

15 views
Skip to first unread message

Federico Bruni

unread,
Mar 24, 2014, 4:29:40 AM3/24/14
to mezzani...@googlegroups.com
I've made the dump of the local database and I've tried to restore it on the server, but I'm getting the error below.
BTW, how can I force the output to be in english? I've tried LANG=C but didn't work. Should I change the locale on the server?

Any help appreciated.

$ pg_restore -d database db.dump
[skipping many lines]

_restore: [archiviatore (db)] Errore nella voce TOC 2142; 2606 26962 FK CONSTRAINT to_blogpost_id_refs_id_6404941b fede
pg_restore: [archiviatore (db)] could not execute query: ERRORE:  il vincolo "to_blogpost_id_refs_id_6404941b" per la relazione "blog_blogpost_related_posts" esiste già
    Command was: ALTER TABLE ONLY blog_blogpost_related_posts
    ADD CONSTRAINT to_blogpost_id_refs_id_6404941b FOREIGN KEY (to_blogpost_id)...
pg_restore: [archiviatore (db)] Errore nella voce TOC 2172; 2606 26967 FK CONSTRAINT twitter_tweet_query_id_fkey fede
pg_restore: [archiviatore (db)] could not execute query: ERRORE:  il vincolo "twitter_tweet_query_id_fkey" per la relazione "twitter_tweet" esiste già
    Command was: ALTER TABLE ONLY twitter_tweet
    ADD CONSTRAINT twitter_tweet_query_id_fkey FOREIGN KEY (query_id) REFERENCES twitter_quer...
pg_restore: [archiviatore (db)] Errore nella voce TOC 2133; 2606 26972 FK CONSTRAINT user_id_refs_id_40c41112 fede
pg_restore: [archiviatore (db)] could not execute query: ERRORE:  il vincolo "user_id_refs_id_40c41112" per la relazione "auth_user_groups" esiste già
    Command was: ALTER TABLE ONLY auth_user_groups
    ADD CONSTRAINT user_id_refs_id_40c41112 FOREIGN KEY (user_id) REFERENCES auth_user(id)...
pg_restore: [archiviatore (db)] Errore nella voce TOC 2135; 2606 26977 FK CONSTRAINT user_id_refs_id_4dc23c39 fede
pg_restore: [archiviatore (db)] could not execute query: ERRORE:  il vincolo "user_id_refs_id_4dc23c39" per la relazione "auth_user_user_permissions" esiste già
    Command was: ALTER TABLE ONLY auth_user_user_permissions
    ADD CONSTRAINT user_id_refs_id_4dc23c39 FOREIGN KEY (user_id) REFERENCES aut...
ATTENZIONE: errore ignorato durante il ripristino: 219

Ken Bolton

unread,
Mar 24, 2014, 9:24:34 AM3/24/14
to mezzanine-users
Hi Federico,

Follow the Fabric task commands precisely to get a good dump/restore process: https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L290-L303.

Make sure also that you created the DB properly – that is, with the correct locale – and that this locale matches the locale of your environment. The relevant part of the fabfile is highlighted here: https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L340-L350.

hth.

best,
ken


--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Federico Bruni

unread,
Mar 25, 2014, 6:30:12 PM3/25/14
to mezzani...@googlegroups.com
Hi Ken

I used the commands in fabfile.py and it worked (despite an error about the 'public' scheme; error ignored).
Thanks!


--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/4NwCIITBzBs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages