Re: Trying to load MySQL data

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Dimitri Fontaine" <dim(at)dalibo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, "garrettmoore(at)gmail(dot)com" <garrettmoore(at)gmail(dot)com>
Subject: Re: Trying to load MySQL data
Date: 2007-01-11 19:02:57
Message-ID: b42b73150701111102o67f931a9n10e79f0aea52dfb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/10/07, Dimitri Fontaine <dim(at)dalibo(dot)com> wrote:
> Hi,
>
> Le mercredi 10 janvier 2007 02:54, garrettmoore(at)gmail(dot)com a écrit:
> > I am working on a project where we are converting from MySQL to
> > Postgres. I figured the easiest way would be to export the MySQL data
> > as CSV.

If you are using pg 8.2+, I've had good luck with the following:

1. create pgsql schema by hand or using some method, so they match mysql
2. mysqldump --compatible=postgresql [yadda] | grep ^INSERT | psql [yadda]

this will work for most data types. as of 8.2, postgresql supports
multiple record inserts, which while not as fast as copy, is pretty
close. if mysqldump is dumping single line inserts, change it to
multiple with -e switch iiirc.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marcus Engene 2007-01-11 19:07:29 generate_series with month intervals
Previous Message Mike Benoit 2007-01-11 18:56:25 Re: ORDER BY col is NULL in UNION causes error?