Re: MySQL DB to PostgresSQL DB - Mailing list pgsql-sql

From Joe
Subject Re: MySQL DB to PostgresSQL DB
Date
Msg-id 446C8350.5010606@freedomcircle.net
Whole thread Raw
In response to MySQL DB to PostgresSQL DB  ("Jose Apablaza" <japablaza@gmail.com>)
List pgsql-sql
Jose Apablaza wrote:
> - Is posible to export MySQL DB to PostgreSQL DB?
> - Does PostgreSQL DB has tools to import MySQL DB?
> - If is posible, How do I need to build the DB in MySQL?, in order to 
> have success in the exportation.
> - Do someone did it before?, exporting MySQL DB to PostgreSQL DB?
> - What kind of risk do we can to have in this process?
> - How long can take this process?

Yes, it's doable, but it's not as straighforward as
   mysqldump -someflags mydbname | psql -someotherflags pgdbname

I suggest you start by checking the resources/articles in the MySQL 
section of http://www.postgresql.org/docs/techdocs.3 (which I'm glad to 
say is much better organized and comprehensive than when I had to do 
it).  FWIW, I converted using CSV as the intermediate format, and the 
dates and timestamps were the trickiest, which required the use of 
"staging" tables (with a textual representation of the columns).  An 
interesting side effect was discovering data inconsistencies in the 
MySQL database since as part of the conversion I implemented foreign key 
constraints under PostgreSQL (which were missing in the former).

Joe


pgsql-sql by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: Constraint question
Next
From: "Guillaume Lelarge"
Date:
Subject: Re: Add column and specify the column position in a table