From: Matthias Apitz <guru@unixarea.de>
To: Postgres general <pgsql-general@postgresql.org>
Subject: Two small questions re/ COPY CSV data into table
Date: Tue, 4 Jun 2019 12:02:47 +0200
Message-ID: <20190604100247.GA2800@c720-r342378> (raw)
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!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: guru@unixarea.de
Subject: Re: Two small questions re/ COPY CSV data into table
In-Reply-To: <20190604100247.GA2800@c720-r342378>
References: <20190604100247.GA2800@c720-r342378>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox