Closed kim-ae closed 8 years ago
The original column datatype is year(4)
in MySQL, and your CAST rule says that it must be translated to integer(4)
, which fails. The current default rule for MySQL year
datatype is the following, please either remove your own cast rule or at least add the drop typemod
part:
type year to integer drop typed
See the current version of the load file at https://github.com/dimitri/pgloader/blob/master/test/sakila.load
Hi @dimitri
2018-10-04T07:36:04.023505Z LOG Migrating from #<MYSQL-CONNECTION mysql://root@10.0.1.28:3306/tune_001 #x302001354D5D>
2018-10-04T07:36:04.024011Z LOG Migrating into #<PGSQL-CONNECTION pgsql://postgres@10.0.1.28:5432/tune_001 #x30200135424D>
2018-10-04T08:11:58.838264Z ERROR Database error 42704: type "datetime" does not exist
QUERY: CREATE TABLE pagila.cb_services
(
sid bigserial not null,
payment_status bigint not null,
service_name varchar(50) not null,
userid bigint not null,
status bigint not null,
deployment_status bigint not null,
date_added timestamp,
date_updated datetime not null,
s_type bigint not null,
quote_id varchar(50) not null,
product_id varchar(50) not null,
quote_number bigint not null,
account_name varchar(50) not null,
account_id varchar(50) not null
)
WITH (fillfactor = '40');
2018-10-04T08:11:58.854049Z FATAL Failed to create the schema, see above.
2018-10-04T08:11:58.856118Z LOG report summary reset
table name errors rows bytes total time
----------------- --------- --------- --------- --------------
before load 0 3 0.012s
fetch meta data 0 349 0.289s
Create Schemas 0 0 0.001s
Create SQL Types 0 147 0.142s
Create tables 0 0 0.000s
----------------- --------- --------- --------- --------------
----------------- --------- --------- --------- -------------```
pgloader -V pgloader version "3.5.2" compiled with SBCL 1.4.0-1.el7
psql (PostgreSQL) 10.5
I am using current version of load fie https://github.com/dimitri/pgloader/blob/master/test/sakila.load please help
@imrantune you didn't paste the PostgreSQL error message, only the query which failed. Please give more information.
@dimitri
2018-10-04T07:36:04.024011Z LOG Migrating into #<PGSQL-CONNECTION pgsql://postgres@10.0.1.28:5432/tune_001 #x30200135424D>
2018-10-04T07:36:05.985268Z ERROR Database error 42704: type "datetime" does not exist
complete error here and updated
I think it's been fixed in https://github.com/dimitri/pgloader/commit/46d14af0d38b26b066876ecf45a2569da31f1d7e ; can you test from a fresh build with current sources?
Hi, I'm starting to learn how to use your tool and as my first attempt I tried to execute the example script that is in the site:
I just modified the information about the postgres to my own (postgresql://postgres@localhost/sakila). The error is the following:
After trying to execute the create statement direct in the pgadmin I discovered that the problem is the integer(4).
My versions
mysql:
postgres:
pgloader:
I hope you can help me. Thanks for your time!