{"id":18895046,"url":"https://github.com/dolthub/pg2mysql","last_synced_at":"2026-03-14T14:04:05.236Z","repository":{"id":44544861,"uuid":"449844736","full_name":"dolthub/pg2mysql","owner":"dolthub","description":"Script to convert Postgres dump files to MySQL dump files","archived":false,"fork":false,"pushed_at":"2023-10-09T22:00:05.000Z","size":124,"stargazers_count":45,"open_issues_count":10,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-15T01:13:30.153Z","etag":null,"topics":["mysql","mysqldump","pgdump","postgres","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dolthub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-19T20:26:59.000Z","updated_at":"2025-04-08T06:14:39.000Z","dependencies_parsed_at":"2023-02-04T13:31:44.780Z","dependency_job_id":null,"html_url":"https://github.com/dolthub/pg2mysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dolthub/pg2mysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fpg2mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fpg2mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fpg2mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fpg2mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dolthub","download_url":"https://codeload.github.com/dolthub/pg2mysql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dolthub%2Fpg2mysql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263108722,"owners_count":23415001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mysql","mysqldump","pgdump","postgres","postgresql"],"created_at":"2024-11-08T08:26:21.260Z","updated_at":"2026-03-14T14:04:00.194Z","avatar_url":"https://github.com/dolthub.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pg2mysql\n\npg2mysql transforms a pgdump file on STDIN into a MySQL dump file on\nSTDOUT. Dump format must be `INSERT` statements, not binary or `COPY`\nstatements (ie. `pg_dump --insert \u003cdbname\u003e`).\n\nUsage:\n\n```\n./pg2mysql.pl \u003c file.pgdump \u003e mysql.sql\n./pg2mysql.pl --skip table1 --skip table2 --insert_ignore \u003c file.pgdump \u003e mysql.sql 2\u003ewarnings.txt\n```\n\nIt handles:\n\n* `CREATE TABLE` statements, types converted to MySQL equivalents\n* `INSERT INTO` statements, some values (like timestamp strings)\n  massaged to work with MySQL\n* `CREATE INDEX` statements\n* `ALTER TABLE` statements (for foreign keys, other constraints)\n* Sequence `nextval` column defaults translated to `auto_increment`\n* With --insert_ignore, uses `INSERT IGNORE` statements to be more\n  lenient with non-confirming values (at the cost of import accuracy)\n  \nAll other statement types other than the ones above are ignored, and\nechoed as SQL comments to STDERR. If you want them in your final\nscript, redirect STDERR to STDOUT with `2 \u003e\u00261` when running the\nscript.\n\n# Known issues\n\nThe script has a lot of limitations and there are surely bugs. If you\nfind some, file an issue to tell us. But these are the things we know\nabout:\n\n* Only tables supported. Other schema entities like triggers, views,\n  stored procedures are not created\n* Some types badly / not supported\n* Will convert a character varying type to longtext if no length is\n  specified, which means MySQL won't be able to make it a key\n\n# Requirements\n\nYou must have Perl installed at `/usr/bin/perl` to run the script directly.\n\n# Credits\n\npg2mysql is heavily inspired and informed by this project of the same\nname: https://github.com/ChrisLundquist/pg2mysql\n\nWhich in turn was adapated from this web form:\nhttp://www.lightbox.ca/pg2mysql.php\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolthub%2Fpg2mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdolthub%2Fpg2mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolthub%2Fpg2mysql/lists"}