pgloader/test/mysql/my.load
Dimitri Fontaine a9afddf8ed Accept quoted namestrings as target type names for cast rules.
This allows passing "double precision" rather than float8, for example.

Fix #650.
2017-10-21 21:03:58 +02:00

24 lines
671 B
Fish

load database
-- from mysql://root@localhost/pgloader
from mysql://root@unix:/tmp/mysql.sock:3306/pgloader
into postgresql:///pgloader
WITH concurrency = 2,
multiple readers per thread,
rows per range = 50000
ALTER SCHEMA 'pgloader' RENAME TO 'mysql'
CAST column utilisateurs__Yvelines2013-06-28.sexe
to text drop not null using empty-string-to-null,
column base64.id to uuid drop typemod,
column base64.data to jsonb using base64-decode,
type decimal
when (and (= 18 precision) (= 6 scale))
to "double precision" drop typemod
BEFORE LOAD DO $$ create schema if not exists mysql; $$;