Re: Error in using copy command
| От | Sindile Bidla |
|---|---|
| Тема | Re: Error in using copy command |
| Дата | |
| Msg-id | BANLkTimGsi6v18DZjHO7A-G6A36hGtjGNQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Error in using copy command (Michael Wood <esiotrot@gmail.com>) |
| Ответы |
Re: Error in using copy command
|
| Список | pgsql-novice |
I have modified my command to: COPY tablename FROM 'myfile' DELIMITER ',' CSV QUOTE '"' ESCAPE E'\\';
following your suggestion but I am still getting the same error
--
Sindile Bidla
Tel: 0823408538
Fax: 0865246419
On 11 May 2011 14:34, Michael Wood <esiotrot@gmail.com> wrote:
Sorry, should be:On 11 May 2011 14:28, Michael Wood <esiotrot@gmail.com> wrote:
> On 11 May 2011 14:09, Sindile Bidla <sindile.bidla@gmail.com> wrote:
>>
>> I get the following error on running COPY - array value must start with "{"
>> or dimension information CONTEXT: copy tablename, line 1, column field1:
>> ""1"".
>> the structure of the csv file is: "1","1","BLOEMSMOND SETTLEMENT
>> AGRICULTURAL HOLDING","00000","","","T618/1943","6.3870 H","NORTHERN
>> CAPE","","*"
>> my copy command looks is: COPY tablename FROM myfile DELIMITER ',';
>
> Try:
>
> COPY tablename FROM 'myfile'
> DELIMITER ','
> CSV QUOTE '"' ESCAPE '\';
>
> (ESCAPE might be wrong depending on what your CSV looks like if one of
> the fields contains a " character.)
...
ESCAPE E'\\'
if you want to use a single \ as an escape character.
--
Sindile Bidla
Tel: 0823408538
Fax: 0865246419
В списке pgsql-novice по дате отправления: