Many "incorrect commands \ N" when trying to restore a PostgreSQL dump

I made a database backup on my mac and tried to restore it on the computer using ubuntu. When I do

psql -U uname -d dbname -f ~/dump_from_mac

      

I have a lot of error messages like "invalid command \ N" and "SomeTable does not exist". My question is very similar to Can't copy a table to another database using pg_dump but I don't know how to fix the dump file. I wipe my Mac and can't create a new dump.

+3


source to share


1 answer


My problem was solved by installing the postgresql-contrib package

sudo apt-get install postgresql-contrib

      

and creating uuid-ossp extension in my db



CREATE EXTENSION "uuid-ossp";

      

My db does not have this extension by default and psql was unable to execute the uuid_generate_v1 () function from my dump file. In most cases, installing postgresql-contrib is sufficient, but sometimes the problem can occur with some missing extensions.

+2


source







All Articles