I have a backup MySQL file, and I'm trying to import that to my PostgreSQL database.
/Users/bheng/Desktop/database_backups/2016-06-10-local.sql
I'm trying to do it via a command line:
psql -d db-local -U root -f ~/Desktop/database_backups/2016-06-10-local.sql
I kept getting
I even try to log in to Postgres and run this it import fine
\i /Users/bheng/Desktop/database_backups/2016-06-10-local.sql
but the same result happens.
Did I do something wrong ? How do I stop/prevent this ?
What worked for me was pgloader. It's very fast + open source under the PostgreSQL License.
The first detail at the top of the website actually mentions migrating from MySQL to PostgreSQL in one command. Good luck!