Skip to content

Instantly share code, notes, and snippets.

@zoglesby
Created November 12, 2013 11:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoglesby/7429537 to your computer and use it in GitHub Desktop.
Save zoglesby/7429537 to your computer and use it in GitHub Desktop.
pgloader example
LOAD DATABASE
FROM mysql://root@localhost/sakila
INTO postgresql://localhost:54393/sakila
WITH include drop, create tables, no truncate,
create indexes, reset sequences, foreign keys
SET maintenance_work_mem to '128MB', work_mem to '12MB',
search_path to 'sakila' /* migrate to a specific schema */
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,
type year to integer
BEFORE LOAD DO
$$ create schema if not exists sakila; $$;
@idrozd
Copy link

idrozd commented Nov 26, 2015

Thx for this, pgloader is so poorly documented.

Nothing helps like a good set of examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment