Easy way to convert mySQL database to postgreSQL?

LeetestUnleet

Senior member
Aug 16, 2002
680
0
0
Ugh... I design a whole website with mySQL databases at the core of it, then when it comes time to upload it to the client's chosen host, the host only supports postgreSQL and not mySQL. It's VERY tedious to convert it all by hand, especially since it's a rather large introductory database. So I was wondering if anyone here knew of a utility that could just do a clean conversion? Preferably would input a .sql or .txt file and output it the same?
 

eklass

Golden Member
Mar 19, 2001
1,218
0
0
you could use something like phpMyAdmin to dump the mysql database to SQL and then load that file into pg. things *should* work although you may have problems if you have anyting mysql-specific in there (like table types or field types)

you may want to google around on converting mysql SQL to pg SQL
if you stick to standard sql statements, you should be fine. guess it looks like you should have thought about database abstraction. PEAR is your friend
 

LeetestUnleet

Senior member
Aug 16, 2002
680
0
0
Yeah, my problem was at first the field types in the tables, but I fixed those. Now the syntax for some input data is going to be messy, since a bunch of " has to be replaced with ', some other things have to be escaped with a \, etc and other stuff like that. I was hoping someone, somewhere had figured out how to do it easier :S