[freeside] Mysql to Postgres?

Randall Lucas rlucas at tercent.net
Tue Nov 25 16:14:27 PST 2003


Folks;

Try searching the pgsql mailing list archives.  There are a few good utilities -- though not perfect -- that can take much of the sting out
of data migration between platforms.

As an example of some of the gotchas,
- MySQL uses ' and " interchangeably, whereas in Postgres ' is used for literal quoting and " is used for internal symbol quoting (e.g.
table names)
- MySQL uses "INSERT INTO table SET column=value" syntax, whereas last I checked Postgres required "INSERT INTO table (column) VALUES
(value)"
- MySQL uses the ghastly AUTO_INCREMENT kludge, whereas Postgres uses sequences and the SERIAL type.
- MySQL will let you use reserved words as table names (like "user") whereas Postgres requires that such names be quoted to avoid name
clash.

There are others, but thank your lucky stars you're going FROM MySQL to Postgres.  The other way around is generally a lot harder, because
once you go Postgres, you start really building an actual database with constraints, triggers, stored procedures, etc, and that stuff just
ain't gonna fly in MySQL!

Randall

Systems Administrator wrote:

> On Tue, 25 Nov 2003, Rob Charles wrote:
>
> > Hello all....
> >
> > Is there a way to transfer an Mysql database to Postgress? As when i export from mysql and then import to postgres I get some errors.
> >
> > Anything I can do?
>
>         What kind of errors?
>
> --
> Tim Nelson
> Systems Administrator
> Sunet Internet
> Tel: +61 3 5241 1155
> Fax: +61 3 5241 6187
> Web: http://www.sunet.com.au/
> Email: sysadmin at sunet.com.au




More information about the freeside-users mailing list