Skip to content

Instantly share code, notes, and snippets.

@dedunumax
Created March 5, 2020 10:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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