Skip to content

Instantly share code, notes, and snippets.

@tombeynon
Created October 5, 2016 15:06
Show Gist options
  • Save tombeynon/35b7f6901a73ab717fc1bb6910063695 to your computer and use it in GitHub Desktop.
Save tombeynon/35b7f6901a73ab717fc1bb6910063695 to your computer and use it in GitHub Desktop.
pg_loader config to migrate a MySQL DB to Postgres
-- See https://github.com/dimitri/pgloader/blob/master/pgloader.1.md for
-- connection string options.
LOAD DATABASE
FROM mysql://root@localhost/mydb
INTO postgresql:///mydb
WITH include drop, truncate, create tables, create indexes, foreign keys, reset sequences
-- CAST varchar to varchar instead of text
CAST type varchar to varchar;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment