If you want to convert from MySQL to PostgreSQL, use the following command to have mysqldump spit out sane SQL:

% mysqldump $DATABASE_NAME -v -nt --compatible=ansi,postgresql --complete-insert=TRUE --extended-insert=FALSE --compact --default-character-set=UTF8 -u $DATABASE_USER -p -r $OUTPUT_FILE

You should then hoopefully be able to load this dump into your PostgreSQL database using

=> \i $OUTPUT_FILE

from within psql.

This piece of information is hidden deeply within the net! It is not clearly written in the mysqldump docs. There are lots of Google results for “MySQL to PostgreSQL” but most of them are needlessly silly and of doubting quality. Spread this info!

Converting the database schema cannot be handled by witty mysqldump switches and is left as an exercise to the reader.