A
A
Alexey Trofimov2014-05-16 15:55:55
MySQL
Alexey Trofimov, 2014-05-16 15:55:55

Convert postgres database to mysql

There is a base in pg without triggers, procedures and other things. How can I transfer the structure, data, foreign keys, unique constraints, indexes to mysql? pg_dump produces a lot of incompatible code.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny Komarov, 2014-05-16
@maNULL

You can't do without a self-written script. On what to write it, decide for yourself, choose what you know better (python, bash). The essence of the task is quite simple - take the sql that pg_dump gave you and replace the DBMS-specific constructs in it. Test on some small table like a reference book. You can probably get by with pure sed .

A
Alexey Lesovsky, 2014-05-16
@lesovsky

Google immediately gives a bunch of links to all sorts of tools. try it and you're sure something will work.
ps I was looking for a similar tool to convert mysql to postgres at one time. It took a little over an hour for all the searches and experiments.

P
Puma Thailand, 2014-05-16
@opium

in pgdump I think there is a compatibility mode like everywhere else, turn it on and fix minor bugs yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question