Re: MySQL to Postgresql schema conversion - Mailing list pgsql-general

From Chris
Subject Re: MySQL to Postgresql schema conversion
Date
Msg-id 48E2B348.6060009@gmail.com
Whole thread Raw
In response to MySQL to Postgresql schema conversion  ("Sean Davis" <sdavis2@mail.nih.gov>)
List pgsql-general
Sean Davis wrote:
> There are a number of mysql to postgresql converters available, but
> many of them have significant shortcomings.  Has anyone found a tool
> that works well?  I am trying to convert a couple of relatively large,
> public schema to postgresql.

I couldn't find anything either but ended up using a pretty simple approach:

- table only dump from mysql (ie no data)
- convert is using sed/perl/whatever takes your fancy
- do a "csv" type dump from mysql (select into outfile) (1/3 of the way
down on http://dev.mysql.com/doc/refman/5.0/en/select.html).
- use "copy" to import the data into postgres
(http://www.postgresql.org/docs/8.3/interactive/sql-copy.html)

That of course assumes you don't have to do any data munging in the
middle (eg different formats for date/time fields).

--
Postgresql & php tutorials
http://www.designmagick.com/


pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Free Cache Memory (Linux) and Postgresql
Next
From: "Rafael Domiciano"
Date:
Subject: Re: [ADMIN] Functions