PG Converter is a command-line utility crafted to simplify the process of converting PostgreSQL dumps into dumps compatible with MySQL.
While the SQL grammar of both database engines shares similarities, there are distinctions in certain areas. This tool specifically focuses on converting SQL statements generated by pg_dump, which include commands for creating tables, indexes, constraints, and inserting data.
If you discover this repository by accident, you will notice the tool is not ready to use. But you can look around and help with bug reports, PRs are appreciated too!
Supported (pg_dump
) statements so far:
- CREATE TABLE
- CREATE INDEX
- ALTER SEQUENCE
- ALTER TABLE ONLY
- COPY
php bin/pg-convert
<src> Postgres source file
<target> Mysql target file
--filterInput="^CREATE INDEX searchindex_keywords_idx"
--appendString="CREATE FULLTEXT INDEX keywords_idx ON searchindex(keywords);"
- e2e tests
- integration tests
This package is inspired by a Perl script by Tim Sehn, and it is based on the wonderful PHP Skeleton by Nuno Maduro.