Mysql – How to convert a MySQL database to PostgreSQL

MySQLmysqldumppostgresql

Is there any command line tool for converting the MySQL database to PostgreSQL? I'd also like to know if there is a way to convert the database using the normal mysqldump command.

Best Answer

have you tried:

mysqldump --compatible=postgresql dbname > export.sql

then do this to escape quotes

sed "s/\\\'/\'\'/g" export.sql > export1.sql

may need some more massaging so look at mysqldump doco more closely.