Open Lucianod28 opened 11 months ago
Same issue on character {
. Quite the same CREATE
statement.
2024-02-28T14:16:45.811995Z ERROR Database error 42601: syntax error at or near "{"
QUERY: CREATE TABLE destination.awesome_table
(
id char(36) not null,
my_awesome_field json not null default '_utf8mb4\'{}\''
);
2024-02-28T14:16:45.815995Z FATAL Failed to create the schema, see above.
I am also affected. I worked around this issue by temporally removing the default value and later adding it back (in the destination database).
I have the same issue in my migration:
2024-04-16T13:54:31.640007Z ERROR Database error 42601: syntax error at or near "["
QUERY: CREATE TABLE public.email_template
(
id int not null,
type varchar(50) not null,
status smallint not null,
version int not null,
subject varchar(250) not null,
body text not null,
created_at timestamptz not null,
updated_at timestamptz not null,
sender_id int,
base_template_id int,
title varchar(255),
settings json default '_utf8mb4\'[]\''
);
2024-04-16T13:54:31.660007Z FATAL Failed to create the schema, see above.
2024-04-16T13:54:31.668007Z LOG report summary reset
table name errors rows bytes total time
----------------- --------- --------- --------- --------------
fetch meta data 0 1514 0.520s
Create Schemas 0 0 0.004s
Create SQL Types 0 0 0.020s
Create tables 0 0 0.000s
----------------- --------- --------- --------- --------------
----------------- --------- --------- --------- --------------
Tried to fix it with something like
before load do $$ alter table email_template alter settings set default null; $$
but had no luck
I'm attempting to migrate my MySQL database with the following command:
pgloader mysql://root:password@db/ATDS postgresql://postgres:password@postgres/atds
but I get:It seems the problem is the
'_utf8mb3\'\''
string which uses backslash-escaped single-qoutes. Any idea on how to fix this? I can't seem to find anything. Thanks!My MySQL schema: