OT: Converting Data From PostGreSQL to MySQL

Tony Wasson ajwasson at gmail.com
Mon Aug 7 08:46:22 MST 2006


On 8/4/06, Gilbert T. Gutierrez, Jr. <plug at phxinternet.net> wrote:
>
> I am not that familiar with PostGreSQL and made a mistake in selecting it
> for this application.  I can, I am sure move the data.  The issue is the
> time it will take me.  Someone that is familiar may be able to do this
> quicker than me.  The app also has a way to export data and then re-import
> it that I may end up using, I am just not comfortable that it will export
> all data.
>

You can move data either way using the dump commands.

For instance:

1) pg_dump -U postgres -D mydb > mydb.sql
  (-D makes extended inserts)
2)  mysql  -u root newdb < mydb.sql

Please watch closely for errors. It is possible you'll need to edit the
table definitions (data types) when converting from 1 DB to another. If you
are using foreign keys you'll need to be careful to select a backend data
type in MySQL that supports this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.plug.phoenix.az.us/pipermail/plug-discuss/attachments/20060807/ef2656d0/attachment.htm


More information about the PLUG-discuss mailing list