Re: ERROR: COPY quote must be a single ASCII character - Mailing list pgsql-general

From brian
Subject Re: ERROR: COPY quote must be a single ASCII character
Date
Msg-id 47AC8906.3070608@zijn-digital.com
Whole thread Raw
In response to Re: ERROR: COPY quote must be a single ASCII character  (Andrej Kastrin <andrej.kastrin@siol.net>)
List pgsql-general
Andrej Kastrin wrote:
>
> Colin Wetherbee wrote:
>> Andrej Kastrin wrote:
>>> ||5354235||,||some text...|| ||1234567||,||some text...||
>>> ||1234568||,||some text...||
>>>
>>> The sql statement I defined was:
>>>
>>> COPY testtable FROM 'test.txt' WITH DELIMITER AS ',' CSV QUOTE AS
>>> '||';
>>>
>>> but the error:
>>>
>>> ERROR: COPY quote must be a single ASCII character
>>
>> I guess I'm stating the obvious here, but can you just change your
>> '||' quotes to a single character within the file?
>>
>> Colin
>>
 > The answer is simple no. I know I can to some preprocessing on input
 > files using awk, sed etc. but don't want to change the structure of
 > the file.

OK, how about replacing '||' with '|' on a *copy* of your file, then?
It's not making that big a change to the structure, in any case.

Otherwise, you won't be able to do what it is that you wish to do. The
delimiter must be a single character, full stop.

brian

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: hyperthreading and pqlib
Next
From: "Bryan Murphy"
Date:
Subject: full text index and most frequently used words