Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a simple tool to convert mysql to postgresql syntax?

Tags:

I've tried the tools listed here, some with more success than others, but none gave me valid postgres syntax I could use (tinyint errors etc.)

like image 569
meleyal Avatar asked Sep 18 '08 12:09

meleyal


People also ask

Can we migrate MySQL to PostgreSQL?

To connect MySQL to PostgreSQL through Foreign Data Wrapper, you must take note of the following as this is what will be required to create the connection: CREATE EXTENSION command to create a MySQL Foreign Data Wrapper extension to the PostgreSQL host. CREATE SERVER command to define a connection to the MySQL Server.

Do PostgreSQL and MySQL have same syntax?

Both MySQL and PostgreSQL databases support stored procedures, but MySQL only supports standard SQL syntaxes, while PostgreSQL supports very advanced procedures. Stored Procedures are implemented in the form of functions in PostgreSQL with a RETURN VOID clause.

Which is easier MySQL or PostgreSQL?

PostgreSQL supports more advanced queries, it performs better on complicated queries, but is harder to manage. MySQL is fast, easy to manage, but you can run into it's limitations on advanced queries, stored procedures and the like.


2 Answers

There's a mysqldump option which makes it output PostgreSQL code:

mysqldump --compatible=postgresql ...

But that doesn't work too well.

Instead, please see the mysql-to-postgres tool as described in Linus Oleander's answer.

like image 90
vog Avatar answered Oct 11 '22 19:10

vog


Try this one , it works like charm !!

http://www.sqlines.com/online
like image 24
R.Sehdev Avatar answered Oct 11 '22 18:10

R.Sehdev