dimitri / pgloader

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

{{{PG_DB_URI}}} error #878

Closed l-we closed 5 years ago

l-we commented 5 years ago
export PG_DB_URI=“postgresql:///pgloader?sslmode=disable&application_name=File_Import”

LOAD CSV
    FROM inline (a, b, nil, t)
INTO {{{PG_DB_URI}}}
  TARGET TABLE temp
    (a,b,nil,t)

    WITH fields terminated by ';'

  BEFORE LOAD DO
  $$ drop table if exists temp; $$,
  $$ CREATE TABLE temp
      (
       a   integer,
       b   timestamp without time zone,
       nil real,
       t   real
      );
  $$;

100;2015-01-01 00:00:00;-6;10
101;2015-01-02 00:00:00;-2.1;12.5
102;2015-01-03 00:00:00;3.4;5.5
103;2015-01-04 00:00:00;4.7;-2.3
104;2015-01-05 00:00:00;0.4;0
KABOOM!
FATAL error: At

    )
    INTO postgresql:///pgloader?sslmode=disable&application_name=File_Import
dimitri commented 5 years ago

The full error message makes it clearer that application_name is not supported in the connection string at this point. Please use the SET clause for that.

At

  postgresql:///pgloader?sslmode=disable&application_name=File_Import
                                                         ^ (Line 1, Column 55, Position 55)

In context DSN-OPTIONS:

While parsing ANOTHER-DSN-OPTION. Expected: