Last active
April 29, 2018 17:17
-
-
Save subhajeet2107/bd7f1f938d581a8c8c39ab4e8271b11f to your computer and use it in GitHub Desktop.
mysql to postgres pgloader load file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load database | |
from mysql://root:password@localhost/database | |
into pgsql://postgres:root@localhost/database | |
WITH include drop, create tables, no truncate, | |
create indexes, reset sequences, foreign keys | |
CAST type datetime to timestamptz | |
drop default drop not null using zero-dates-to-null, | |
type date drop not null drop default using zero-dates-to-null | |
BEFORE LOAD DO | |
$$ create schema if not exists database_name; $$; | |
#sudo pgloader -v ec.load | |
# Run : ALTER DATABASE db_name SET search_path TO public, db_name; if tables are not visible using \dt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment