OT: help with pgloader

From: Sbob <sbob(at)quadratum-braccas(dot)com>
To: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: OT: help with pgloader
Date: 2024-07-09 22:36:33
Message-ID: 85b3aab6-91ef-496e-88d5-047f170e1a06@quadratum-braccas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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"

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Erik Wienhold 2024-07-09 23:47:26 Re: OT: help with pgloader
Previous Message Sathish Reddy 2024-07-09 06:25:19 Re: Detach partition concurrently from pg cron