Re: migrate from postgres to mysql - Mailing list pgsql-general

From Harald Fuchs
Subject Re: migrate from postgres to mysql
Date
Msg-id puy8vyebjy.fsf@srv.protecting.net
Whole thread Raw
In response to migrate from postgres to mysql  ("Fabio Benavides Murillo" <fabio@novasitios.com>)
List pgsql-general
In article <1065126701.1431.8.camel@localhost.localdomain>,
Scott Cain <cain@cshl.org> writes:

> Well, I've not done it, but you could do a
>   pg_dump -s dbname >schema.sql
>   pg_dump -d -a dbname >data.sql

> to get just the schema in one file and the data in inserts in another
> file.  Then you could use a perl script driven by SQL::Translator (check
> http://www.cpan.org) to translate the schema from Pg to MySQL.  Create
> the schema in MySQL, then load via the inserts.

I'd replace the second call of pg_dump by a "COPY mytbl TO 'mytbl.txt'"
for each table in the DB and import it into MySQL with "LOAD DATA
[LOCAL] INFILE".  This would be much faster than INSERTing.

pgsql-general by date:

Previous
From: Shridhar Daithankar
Date:
Subject: Re: PITR (was Re: Type of application that use
Next
From: Christopher Browne
Date:
Subject: Re: book on advanced postgresql?