Re: Importing MySQL dump into PostgreSQL 8.2

From: Chris <dmagick(at)gmail(dot)com>
To: delux256-postgresql(at)yahoo(dot)com
Cc: PostgreSQL GENERAL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Importing MySQL dump into PostgreSQL 8.2
Date: 2007-10-05 04:06:41
Message-ID: 4705B851.1080209@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Lanzarotta wrote:
> Hello,
>
> I have a MySQL dump file that I would like to import into our PostgreSQL
> 8.2 database. Is there a way to do this?

You'll need to convert the table definitions then the data.

For example, mysql has int(11) columns, postgres only has int columns.

I usually convert the tables, then do a csv dump from mysql:

select * from table into outfile '/path/to/file';

then import into postgres:

\copy table from '/path/to/file'

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris 2007-10-05 04:11:26 Re: SLOW Remote Connection to PostgreSQL Database
Previous Message Michael Glaesemann 2007-10-04 22:47:44 Re: It's time to support GRANT SELECT, UPDATE, ..., ..., ... ON database.* to username