GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mashuai720/mysql2pgsql: updated mysql2pgsql

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
test
test
 
 
README.markdown
README.markdown
 
 
mysql2pgsql.pl
mysql2pgsql.pl
 
 

Repository files navigation

Migrating from MySQL to Postgresql

Step 1: Create a proper mysql dump

mysqldump --hex-blob dbname > dbname_mysql.sql

Step 2: Convert your dump to postgres style

Use the included script. I've fixed it up with better support for foreign keys (it puts all the constraint creation at the bottom of the file) and FKs with multiple column references.

./mysql2pgsql.pl --sepfile constraints.sql --nodrop dbname_mysql.sql dbname_pg.sql

Step 3: Import

Make sure you have created the database first.

psql -f dbname_pg.sql `psql -f constraints.sql

Notes:

  • If you want to be notified of errors in your dump, do \set ON_ERROR_STOP 1

  • Make sure your mysql tables are all utf8 first

  • Dumps do not work well with BLOB data. MySQL uses 0x1234, Pg uses E'\x1234'. Don't use BLOBs if you can avoid it in general.

  • The test directory contains some simple tests, which are not comprehensive. cd test; ./run_test.sh to run the tests.

  • If you have anything to add, please let me know

About

updated mysql2pgsql

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.