Thread: From Mysql to Postgre, how to do that?

From Mysql to Postgre, how to do that?

From
antti.ijas@arcada.fi (Antti Ijäs)
Date:
Hi!

I currently have a Mysql database which I would like to convert to
PostgreSQL.
Any ideas of how to do that? I understood there is a script somewhere
but what "pre-actions" would I have to make to use the script?

I'm quite new with databases in the Linux world + I don't have much
experience of Linux itself, so I would rather take "step-by-step"
advises. Hope that's okey :-\

Anyway thanx for your time!

Best regards, Antti

Re: From Mysql to Postgre, how to do that?

From
Keary Suska
Date:
Because MySQL does not support advanced features such as functions, the only
issues would be with the schema. IIRC you can extract just the schema, and
modify it for loading into Postgres. You should also be able to extract the
data as SQL insert statements.

Mostly, the conversions issues have to do with column type. MySQL supports a
large number of different types, and these will have to be converted to the
closest equivalent in Postgres. If you have any BLOBs, the problem is a bit
tougher, but not insurmountable.

Another issue is that Postgres does not support the "KEY" attribute of a
column, which in MySQL simply means to index the column. You will have to
create explicit CREATE INDEX statements for these columns.

All in all, when you try to upload the schema into Postgres, Postgres will
tell you what it doesn't like, usually fairly clearly as long as the SQL is
syntactically correct.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

> From: antti.ijas@arcada.fi (Antti Ijäs)
> Organization: http://groups.google.com/
> Date: 3 Oct 2001 03:16:50 -0700
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] From Mysql to Postgre, how to do that?
>
> Hi!
>
> I currently have a Mysql database which I would like to convert to
> PostgreSQL.
> Any ideas of how to do that? I understood there is a script somewhere
> but what "pre-actions" would I have to make to use the script?
>
> I'm quite new with databases in the Linux world + I don't have much
> experience of Linux itself, so I would rather take "step-by-step"
> advises. Hope that's okey :-\
>
> Anyway thanx for your time!
>
> Best regards, Antti
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>