I'm running this command to export a database:

sudo PGUSER="postgres" PGPASSWORD="D" /Library/PostgreSQL/9.5/pgAdmin3.app/Contents/SharedSupport/pg_dump --format=c okay_db_3 > '/Volumes/1TB/databasebackutest.backup'

And it works fine no error.

But I don't know how to restore. So far I've tried:

PGUSER="postgres" PGPASSWORD="D" /Library/PostgreSQL/9.5/pgAdmin3.app/Contents/SharedSupport/pg_restore -F c -v -U postgres -d okay_db3recover1 /Volumes/1TB/databasebackutest.backup 


sudo PGUSER="postgres" PGPASSWORD="D" /Library/PostgreSQL/9.5/pgAdmin3.app/Contents/SharedSupport/pg_restore --dbname=okay_db_mac /Volumes/1TB/databasebackutest.backup 

but no luck. I'm getting

[archiver (db)] Error from TOC entry 3847; 2606 41233 CONSTRAINT Sm2SequenceContainer_Sm2TiTrack_pkey postgres

when I try to report the database back

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.