dimitri / pgloader

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

Error loading sqlite if type name contains parentheses #1515

Open e-kondr01 opened 1 year ago

e-kondr01 commented 1 year ago

SQLite DB I'm trying to load contains type name "varchar2(60)". Seems like parentheses are disallowed characteres for type names. I tried casting it with:

CAST
     type "varchar2(60)" to text drop typemod;

with no success.

Yes

Yes


2023-07-31T16:58:35.004000+03:00 LOG pgloader version "3.6.999791d"
2023-07-31T16:58:35.008000+03:00 LOG Data errors in '/tmp/pgloader/'
2023-07-31T16:58:35.008000+03:00 LOG Parsing commands from file #P"/home/egor/coding/SQLiteDB/db.load"
2023-07-31T16:58:35.052000+03:00 LOG Migrating from #<SQLITE-CONNECTION sqlite:///home/egor/coding/SQLiteDB/KIN_MAY_NONAME_19.06.2023_19.43.59.sqldb {10081B5EF3}>
2023-07-31T16:58:35.052000+03:00 LOG Migrating into #<PGSQL-CONNECTION pgsql://database@localhost:5439/database {10081B6B53}>
2023-07-31T16:58:35.088000+03:00 ERROR sqlite: At

  varchar2(60)
         ^ (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 <end of input>
2023-07-31T16:58:35.088000+03:00 LOG report summary reset
       table name     errors       rows      bytes      total time
-----------------  ---------  ---------  ---------  --------------
            fetch          0          0                     0.000s
  fetch meta data          0          0                     0.000s
-----------------  ---------  ---------  ---------  --------------
-----------------  ---------  ---------  ---------  --------------