Two small questions re/ COPY CSV data into table

Поиск
Список
Период
Сортировка
От Matthias Apitz
Тема Two small questions re/ COPY CSV data into table
Дата
Msg-id 20190604100247.GA2800@c720-r342378
обсуждение исходный текст
Ответы Re: Two small questions re/ COPY CSV data into table  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список 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 по дате отправления:

Предыдущее
От: Matteo Beccati
Дата:
Сообщение: Research on ?? operators
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: Two small questions re/ COPY CSV data into table