OT: help with pgloader - Mailing list pgsql-admin

From Sbob
Subject OT: help with pgloader
Date
Msg-id 85b3aab6-91ef-496e-88d5-047f170e1a06@quadratum-braccas.com
Whole thread Raw
Responses Re: OT: help with pgloader
List pgsql-admin
All;


I created a few tables with pgbench, then I did this:

1)  copied the data from pgbench_accounts to a data file with a pipe '|' 
delimiter:

  copy pgbench_accounts to '/var/lib/pgsql/copy/pgbench_accounts.dat' 
delimiter ' ;


2) installed pgloader

# dnf -y install pgloader


3) deleted all data from the pgbench_accounts table:

DELETE FROM pgbench_accounts ;


4) created a copy.load file that looks like this:

$ cat copy.load
LOAD COPY
  FROM copy://./pgbench_accounts3.dat
  INTO postgresql://localhost/postgres
TARGET TABLE public.pgbench_accounts
  WITH delimiter '|'


However pgloader bombs on the delimiter (see below)

Can someone point me in the right direction ?


Thanks in advance




pgloader run:


$ pgloader copy.load
2024-07-09T23:26:21.005000+01:00 LOG pgloader version "3.6.7~devel"
2024-07-09T23:26:21.006000+01:00 LOG Data errors in '/tmp/pgloader/'
2024-07-09T23:26:21.006000+01:00 LOG Parsing commands from file 
#P"/var/lib/pgsql/copy/copy.load"
KABOOM!
ESRAP-PARSE-ERROR: At

   TARGET TABLE public.pgbench_accounts
    WITH delimiter '|'

                      ^ (Line 5, Column 19, Position 141)

In context COMMAND:

While parsing COMMAND. Expected:

      the character Tab
   or the character Newline
   or the character Return
   or the character Space
   or the character , (COMMA)
   or the string "--"
   or the string "/*"
   or the character ; (SEMICOLON)
   or the string "after"
   or the string "before"
   or the string "set"
   or the string "with"
An unhandled error condition has been signalled: At

   TARGET TABLE public.pgbench_accounts
    WITH delimiter '|'

                      ^ (Line 5, Column 19, Position 141)

In context COMMAND:

While parsing COMMAND. Expected:

      the character Tab
   or the character Newline
   or the character Return
   or the character Space
   or the character , (COMMA)
   or the string "--"
   or the string "/*"
   or the character ; (SEMICOLON)
   or the string "after"
   or the string "before"
   or the string "set"
   or the string "with"




What I am doing here?

At

   TARGET TABLE public.pgbench_accounts
    WITH delimiter '|'

                      ^ (Line 5, Column 19, Position 141)

In context COMMAND:

While parsing COMMAND. Expected:

      the character Tab
   or the character Newline
   or the character Return
   or the character Space
   or the character , (COMMA)
   or the string "--"
   or the string "/*"
   or the character ; (SEMICOLON)
   or the string "after"
   or the string "before"
   or the string "set"
   or the string "with"







pgsql-admin by date:

Previous
From: Sathish Reddy
Date:
Subject: Re: Detach partition concurrently from pg cron
Next
From: Erik Wienhold
Date:
Subject: Re: OT: help with pgloader