This is an old revision of the document!
Technical information on migration from MySQL to PostgreSQL.
Last Update: MySQL 5.6 and PostgreSQL 9.2
Converting built-in SQL data types:
MySQL | PostgreSQL | |||||
1 | INT(m) | 32-bit integer | INT |
Converting CREATE TABLE statement keywords and clauses:
MySQL | PostgreSQL | |
1 | AUTO_INCREMENT column property | Sequence and DEFAULT nextval('seq_name') |
2 | COLLATE name | Removed |
Storage and table attributes:
MySQL | PostgreSQL | |
1 | AUTO_INCREMENT = start_value table option | ALTER SEQUENCE seq_name RESTART WITH start_value |
Converting other SQL statements:
MySQL | PostgreSQL | |
1 | CREATE DATABASE [IF NOT EXISTS] name | CREATE DATABASE name |
2 | DROP TABLE [IF EXISTS] table | DROP TABLE [IF EXISTS] table |