dimitri / pgloader

Migrate to PostgreSQL in a single command!
http://pgloader.io
Other
5.45k stars 548 forks source link

Problem SQLITE-TYPE-NAME #1533

Open enck19 opened 1 year ago

enck19 commented 1 year ago

hi, need help to cast custom type in sqlite, my sqlite file have this structure CREATE TABLE item ( id TEXT, description TEXT, um TEXT, method_set INTEGER, method_default INTEGER, method_grid NUMERIC[], method_graph NUMERIC[], level INTEGER DEFAULT 0, active INTEGER DEFAULT 0, PRIMARY KEY(id) );

data example on method_grid data [1,2] data example on method_graph [3,4]

thanks

--
-pgloader -v -d --context ./pgloader.ini -L pgloader.log -D workdir -S pgloader.summary  db.load
--

load database
     FROM sqlite://$path/project.db
     INTO postgresql://{{PGUSER}}:{{PGPASSWORD}}@{{DBHOST}}/{{DB}}

    WITH include drop, create tables, create indexes, reset sequences

      SET PostgreSQL PARAMETERS maintenance_work_mem to '1024MB', work_mem to '1024', search_path to '$schemanum'

       CAST
      type date drop not null drop default using zero-dates-to-null,
      type datetime to timestamp drop default using zero-dates-to-null

    BEFORE LOAD DO
   $$ drop schema IF EXISTS $schemanum cascade; $$,
   $$ create schema $schemanum; $$;

  - [ ] pgloader output you obtain

2023-10-06T17:43:13.069000+02:00 SQL SQLite: SELECT tbl_name FROM sqlite_master WHERE tbl_name = 'sqlite_sequence' 2023-10-06T17:43:13.075000+02:00 SQL SELECT tbl_name FROM sqlite_master WHERE type='table' AND tbl_name <> 'sqlite_sequence'

2023-10-06T17:43:13.082000+02:00 ERROR sqlite: At

numeric[] ^ (Line 1, Column 7, Position 7)

In context SQLITE-TYPE-NAME:

While parsing SQLITE-TYPE-NAME. Problem:

The production #\]

does not satisfy the predicate ALPHA-CHAR-P.

Expected:

the character _ (LOW_LINE)

or any character satisfying ALPHA-CHAR-P or 2023-10-06T17:43:13.082000+02:00 LOG report summary reset 2023-10-06T17:43:13.107000+02:00 INFO Stopping monitor


  - [ ] data that is being loaded, if relevant

no data