dimitri / pgloader

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

Underscore in host does not work / how to escape underscore in host name #1579

Open Anubarak opened 5 months ago

Anubarak commented 5 months ago
--
-- EDIT THIS FILE TO MATCH YOUR BUG REPORT
--
LOAD DATABASE
     FROM      mysql://myuser:pA>q2qz+6q3%[%6]@test_mysql:3306/my_table
     INTO postgresql://myuser:pA>q2qz+6q3%[%6]@test_pgsql:5432/my_table
;
2024-04-22T14:09:09.030000Z LOG pgloader version "3.6.9"
2024-04-22T14:09:09.050000Z LOG Parsing commands from file #P"/app/my.load"
KABOOM!
ESRAP-PARSE-ERROR: At

  LOAD DATABASE
       FROM      mysql://myuser:pA>q2qz+6q3%[%6]@test_mysql:3306/my_table

                                                     ^ (Line 2, Column 51, Position 65)

In context MYSQL-URI:

While parsing DSN-DBNAME. Expected:

     the character / (SOLIDUS)

While parsing DSN-PORT. Expected:

     the character : (COLON)

While parsing NETWORK-HOSTNAME. Problem:

  The production

    #\_

  does not satisfy the predicate ALPHA-CHAR-P.

Expected:

     the character - (HYPHEN-MINUS)
  or the character . (FULL_STOP)
  or any character satisfying DIGIT-CHAR-P
  or any character satisfying ALPHA-CHAR-P
An unhandled error condition has been signalled: At

  LOAD DATABASE
       FROM      mysql://myuser:pA>q2qz+6q3%[%6]@test_mysql:3306/my_table

                                                     ^ (Line 2, Column 51, Position 65)

In context MYSQL-URI:

While parsing DSN-DBNAME. Expected:

     the character / (SOLIDUS)

While parsing DSN-PORT. Expected:

     the character : (COLON)

While parsing NETWORK-HOSTNAME. Problem:

  The production

    #\_

  does not satisfy the predicate ALPHA-CHAR-P.

Expected:

     the character - (HYPHEN-MINUS)
  or the character . (FULL_STOP)
  or any character satisfying DIGIT-CHAR-P
  or any character satisfying ALPHA-CHAR-P

What I am doing here?

At

  LOAD DATABASE
       FROM      mysql://myuser:pA>q2qz+6q3%[%6]@test_mysql:3306/my_table

                                                     ^ (Line 2, Column 51, Position 65)

In context MYSQL-URI:

While parsing DSN-DBNAME. Expected:

     the character / (SOLIDUS)

While parsing DSN-PORT. Expected:

     the character : (COLON)

While parsing NETWORK-HOSTNAME. Problem:

  The production

    #\_

  does not satisfy the predicate ALPHA-CHAR-P.

Expected:

     the character - (HYPHEN-MINUS)
  or the character . (FULL_STOP)
  or any character satisfying DIGIT-CHAR-P
  or any character satisfying ALPHA-CHAR-P
PASTE HERE THE DATA THAT HAS BEEN LOADED
Not relevant

actually I don't really understand your template so I'll just write my issue without it here again.

I have a db host name that contains underscores but I am not able to properly escape them, can you please tell me how to do that? My host is for example test_mysql but I always receive an error no matter what I do