FAQ
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 ',';

Search Discussions

  • Michael Wood at May 11, 2011 at 12:28 pm

    On 11 May 2011 14:09, Sindile Bidla 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.)

    --
    Michael Wood <esiotrot@gmail.com>
  • Michael Wood at May 11, 2011 at 12:35 pm

    On 11 May 2011 14:28, Michael Wood wrote:
    On 11 May 2011 14:09, Sindile Bidla 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.)
    Sorry, should be:

    ...
    ESCAPE E'\\'

    if you want to use a single \ as an escape character.

    --
    Michael Wood <esiotrot@gmail.com>
  • Sindile Bidla at May 11, 2011 at 1:08 pm
    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
    On 11 May 2011 14:34, Michael Wood wrote:
    On 11 May 2011 14:28, Michael Wood wrote:
    On 11 May 2011 14:09, Sindile Bidla 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.)
    Sorry, should be:

    ...
    ESCAPE E'\\'

    if you want to use a single \ as an escape character.

    --
    Michael Wood <esiotrot@gmail.com>


    --
    Sindile Bidla
    Tel: 0823408538
    Fax: 0865246419
  • Michael Wood at May 11, 2011 at 1:44 pm

    On 11 May 2011 15:07, Sindile Bidla wrote:
    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
    What is the table definition?
    On 11 May 2011 14:34, Michael Wood wrote:
    On 11 May 2011 14:28, Michael Wood wrote:
    On 11 May 2011 14:09, Sindile Bidla 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.)
    Sorry, should be:

    ...
    ESCAPE E'\\'

    if you want to use a single \ as an escape character.
    --
    Michael Wood <esiotrot@gmail.com>
  • Sindile Bidla at May 11, 2011 at 4:11 pm
    It works and thank you
    On 11 May 2011 15:42, Michael Wood wrote:
    On 11 May 2011 15:07, Sindile Bidla wrote:
    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
    What is the table definition?
    On 11 May 2011 14:34, Michael Wood wrote:
    On 11 May 2011 14:28, Michael Wood wrote:
    On 11 May 2011 14:09, Sindile Bidla 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.)
    Sorry, should be:

    ...
    ESCAPE E'\\'

    if you want to use a single \ as an escape character.
    --
    Michael Wood <esiotrot@gmail.com>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedMay 11, '11 at 12:10p
activeMay 11, '11 at 4:11p
posts6
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Sindile Bidla: 3 posts Michael Wood: 3 posts

People

Translate

site design / logo © 2021 Grokbase