dimitri / pgloader

Migrate to PostgreSQL in a single command!

Home Page:http://pgloader.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Anubarak opened this issue · comments

  • pgloader --version

    pgloader version "3.6.9"
    compiled with SBCL 2.3.4
    
  • did you test a fresh compile from the source tree?

    Compiling pgloader from sources is documented in the
    README, it's
    easy to do, and if patches are to be made to fix your bug, you're going
    to have to build from sources to get the fix anyway…

  • did you search for other similar issues?

  • how can I reproduce the bug?
    have a DB with a host that contains underscores for example "test_pgsql"

--
-- 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
;
  • pgloader output you obtain
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
  • data that is being loaded, if relevant
PASTE HERE THE DATA THAT HAS BEEN LOADED
Not relevant
  • How the data is different from what you expected, if 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

  • test\_mysql
  • "test_mysql"
  • test\\_mysql