Two small questions re/ COPY CSV data into table - Mailing list pgsql-general

From Matthias Apitz
Subject Two small questions re/ COPY CSV data into table
Date
Msg-id 20190604100247.GA2800@c720-r342378
Whole thread Raw
Responses Re: Two small questions re/ COPY CSV data into table
List pgsql-general
Hello,

I'm using COPY to load CSV data into the table in PG 10.x and have to simple
questions:

1. I do use as command:

   COPY adm_cat FROM '/home/sisis/PostgreSQL/PDcsv/adm_cat.load' WITH DELIMITER '|' CSV ;

   which works fine. When I read the PG docs the syntax should be

   ... WITH DELIMITER '|', FORMAT CSV ;

   But this gives an syntax error as:

   LINE 1: .../PostgreSQL/PDcsv/adm_cat.load' WITH DELIMITER '|', FORMAT C...

   and the ',' is marked as its place. Why?
  
2. The CSV export is done by some Sybase tool which escapes the
   delimiter as '\|', i.e. putting a backslash before the delimiter. I
   found no way that COPY understands this excaping. Any ideas?

Thanks

    matthias
-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!



pgsql-general by date:

Previous
From: Matteo Beccati
Date:
Subject: Research on ?? operators
Next
From: Andrew Gierth
Date:
Subject: Re: Two small questions re/ COPY CSV data into table