What's the best way to backup a postgresql database?
I've tried using the documentation at www.postgresql.org, but I always get integrity errors when restoring.
Right now I'm using this for backup:
pg_dump -U myuser -d mydatabase db.pg.dump
pg_restore -c -r -U myuser -d mydatabase db.pg.dump
But I'm not getting the desired results..
Edit: I should note, my db has a lot of foreign keys..
Some of the errors I see are:
ERROR: current transaction is aborted, commands ignored until end of transaction block ERROR: zero-length delimited identifier at or near """" LINE 1: ..._text_id_fkey" FOREIGN KEY ("text_id") REFERENCES ""."wiki_t...