RE: ERROR: COPY escape must be a single one-byte character (multi-delimiter appears to work on Postgres 9.0 but does not on Postgres 9.2)

From: Kevin Brannen <KBrannen(at)efji(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: ERROR: COPY escape must be a single one-byte character (multi-delimiter appears to work on Postgres 9.0 but does not on Postgres 9.2)
Date: 2019-11-14 15:14:57
Message-ID: DM6PR19MB3451CCA94CA104573F8C3C48A4710@DM6PR19MB3451.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>Adrian Klaver wrote:
>On 11/13/19 4:40 PM, Brandon Ragland wrote:
>> Hello,
>>
>> I have a Talend enterprise job that loads data into a PostgreSQL
>> database via the COPY command. When migrating to a new server this
>> command fails with the following error message:
>> org.postgresql.util.PSQLException:ERROR: COPY escape must be a single
>> one-byte character
>
>Does the Postgres log offer anymore information?
>
>Can you crank up the error level to get more info?
>
>Are the encodings for the Postgres server/OS different ?

What is the COPY command you're using?

To extend Adrian's good questions, have you really examined the line in
question carefully with a tool that will show you the true characters being
used? You didn't show the COPY command, but to me, this sounds like you
have a "fancy" character happening. The place I most often see this is
with double quotes:

U+0022 normal ASCII " (1 byte)
U+201c left double quote (2 bytes!)

Depending on the font used, those 2 can look very much alike and
there are far more characters that can be mixed up like this. The
insidious ones for me are the whitespace chars, e.g. 0xa0. I find this
happens frequently when the source of a copy-paste is from another
program, e.g. MS-Word; our ticket system did this for awhile too. :(

HTH,
Kevin
This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-11-14 15:30:33 Re: Problems modifyiong view
Previous Message Tom Lane 2019-11-14 15:12:22 Re: Problems modifyiong view