Open myles-mcdonnell opened 4 years ago
Hi @myles-mcdonnell ; can you please paste the output of the following query done in your MySQL source database?
select c.table_name, t.table_comment,
c.column_name, c.column_comment,
c.data_type, c.column_type, c.column_default,
c.is_nullable, c.extra
from information_schema.columns c
join information_schema.tables t using(table_schema, table_name)
where c.table_schema = 'goodtorent' and table_name = 'admin_call_comments'
order by table_name, ordinal_position;
I have the same issue now and I use macOS Catalina 10.15.4 with newest pgloader from brew (same as @myles-mcdonnell).
2020-04-17T11:34:48.008000+01:00 LOG pgloader version "3.6.2"
2020-04-17T11:34:48.083000+01:00 LOG Migrating from #<MYSQL-CONNECTION mysql://patryk@localhost:3306/stolarz {1005CC7A33}>
2020-04-17T11:34:48.084000+01:00 LOG Migrating into #<PGSQL-CONNECTION pgsql://patryk@localhost:5432/stolarz {1005CC9223}>
2020-04-17T11:34:48.268000+01:00 ERROR Database error 42601: syntax error at or near "unsigned"
QUERY: CREATE TABLE public.tagging_taggeditem
(
id int not null,
object_id int unsigned not null,
content_type_id int not null,
tag_id int not null
);
2020-04-17T11:34:48.268000+01:00 FATAL Failed to create the schema, see above.
2020-04-17T11:34:48.268000+01:00 LOG report summary reset
table name errors rows bytes total time
----------------- --------- --------- --------- --------------
fetch meta data 0 140 0.060s
Create Schemas 0 0 0.001s
Create SQL Types 0 0 0.004s
Create tables 0 0 0.000s
----------------- --------- --------- --------- --------------
----------------- --------- --------- --------- --------------
Ok, so I noticed that there is no int
variable type (only integer
), so I tried to test this script:
LOAD DATABASE
FROM mysql://patryk:pass1234@localhost/stolarz
INTO pgsql://patryk:pass1234@localhost/stolarz
WITH
batch rows = 1000,
batch size = 512 MB,
prefetch rows = 20000
CAST
type datetime to timestamp drop default drop not null using zero-dates-to-null,
type int when unsigned to bigint drop typemod
ALTER SCHEMA 'stolarz' RENAME TO 'public';
Convertation passed, but I noticed that id
were null in my DB (I use Django for my projects), so something went wrong. Gonna check that later.
Hi
I'm migrating a DB from MySql 8.x to PG 10.2.x When I run:
The result is:
but if I understand the documentation correctly this shouldn't happen due to the default casting rules
https://pgloader.readthedocs.io/en/latest/ref/mysql.html#default-mysql-casting-rules
[x] pgloader --version
No, I installed via brew
Yes.
I'm not using a command file, I'm relying on defaults using the following command:
Thank you Myles