dimitri / pgloader

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

Pgloader is erroring out for PG URI with IPV6 Host #1004

Open WazzaRD10 opened 5 years ago

WazzaRD10 commented 5 years ago

LOAD CSV
     FROM '/u02/netcracker/rbm/rbmvm/infinys_root/a.csv' WITH ENCODING UTF8 (COLUMN1,COLUMN2)
    INTO postgresql://netcrk:crknet@[fd95:ff55:7fb8:f1e5:f816:3eff:fe5d:96b7]:5432/postgres
    TARGET TABLE TESTACCOUNT(COLUMN1,COLUMN2)

      WITH  TRUNCATE,
       SKIP HEADER = 0,
       FIELDS OPTIONALLY ENCLOSED BY '"',
       FIELDS TERMINATED BY ','

      SET CLIENT_ENCODING TO 'UTF8,
            work_mem to '128MB',
          standard_conforming_strings to 'on'

    BEFORE LOAD DO $$ CREATE SCHEMA IF NOT EXISTS PUBLIC; $$,
 $$ CREATE TABLE IF NOT EXISTS PUBLIC.TESTACCOUNT(COLUMN1 INTEGER,COLUMN2 INTEGER); 
 $$;
2019-07-26T17:28:53.045000+01:00 LOG pgloader version "3.6.1"
KABOOM!
FATAL error: At

   LOAD CSV FROM '/u02/netcracker/rbm/rbmvm/infinys_root/a.csv' WITH ENCODING UTF8 (COLUMN1,COLUMN2) INTO postgresql://netcrk:crknet@[fd95:ff55:7fb8:f1e5:f81
                                                                                                                                     ^ (Line 1, Column 131, Position 131)

In context PGSQL-URI:

While parsing DSN-DBNAME. Expected:

     the character / (SOLIDUS)

While parsing DSN-PORT. Expected:

     the character : (COLON)

While parsing NAMESTRING. Problem:

  The production

    #\[

  does not satisfy the predicate ALPHA-CHAR-P.

Expected:

     the character _ (LOW_LINE)
  or any character satisfying ALPHA-CHAR-P

While parsing SOCKET-DIRECTORY. Expected:

     the string "unix:"

While parsing IPV4-PART. Problem:

  The production

    #\[

  does not satisfy the predicate DIGIT-CHAR-P.

Expected:

     any character satisfying DIGIT-CHAR-P
An unhandled error condition has been signalled: At

   LOAD CSV FROM '/u02/netcracker/rbm/rbmvm/infinys_root/a.csv' WITH ENCODING UTF8 (COLUMN1,COLUMN2) INTO postgresql://netcrk:crknet@[fd95:ff55:7fb8:f1e5:f81
                                                                                                                                     ^ (Line 1, Column 131, Position 131)

In context PGSQL-URI:

While parsing DSN-DBNAME. Expected:

     the character / (SOLIDUS)

While parsing DSN-PORT. Expected:

     the character : (COLON)

While parsing NAMESTRING. Problem:

  The production

    #\[

  does not satisfy the predicate ALPHA-CHAR-P.

Expected:

     the character _ (LOW_LINE)
  or any character satisfying ALPHA-CHAR-P

While parsing SOCKET-DIRECTORY. Expected:

     the string "unix:"

While parsing IPV4-PART. Problem:

  The production

    #\[

  does not satisfy the predicate DIGIT-CHAR-P.

Expected:

     any character satisfying DIGIT-CHAR-P

What I am doing here?

At

   LOAD CSV FROM '/u02/netcracker/rbm/rbmvm/infinys_root/a.csv' WITH ENCODING UTF8 (COLUMN1,COLUMN2) INTO postgresql://netcrk:crknet@[fd95:ff55:7fb8:f1e5:f81
                                                                                                                                     ^ (Line 1, Column 131, Position 131)

In context PGSQL-URI:

While parsing DSN-DBNAME. Expected:

     the character / (SOLIDUS)

While parsing DSN-PORT. Expected:

     the character : (COLON)

While parsing NAMESTRING. Problem:

  The production

    #\[

  does not satisfy the predicate ALPHA-CHAR-P.

Expected:

     the character _ (LOW_LINE)
  or any character satisfying ALPHA-CHAR-P

While parsing SOCKET-DIRECTORY. Expected:

     the string "unix:"

While parsing IPV4-PART. Problem:

  The production

    #\[

  does not satisfy the predicate DIGIT-CHAR-P.

Expected:

     any character satisfying DIGIT-CHAR-P
1,1
1,2
1,3
stackcoder commented 1 month ago

I can confirm this issue using version:

pgloader version "3.6.9"
compiled with SBCL 2.4.4