Created
March 5, 2020 10:40
-
-
Save dedunumax/d8b2cdbf0218b03fc0c17289ae27a726 to your computer and use it in GitHub Desktop.
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://<mysql_user>:<mysql_password>@<mysql_host>/<source_databases> | |
INTO pgsql://<postgres_user>:<postgres_password>@<postgres_host>/<target_database> | |
WITH INCLUDE DROP, CREATE TABLES | |
SET search_path to 'public' | |
INCLUDING ONLY TABLE NAMES MATCHING 'sample_table' | |
ALTER TABLE NAMES MATCHING 'sample_table' RENAME TO 'tmp_sample_table' | |
ALTER SCHEMA '<source_databases>' RENAME TO 'public'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment