Re: help with COPY from .csv file into database

From: michael(at)floog(dot)net
To: olly(at)lfix(dot)co(dot)uk
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: help with COPY from .csv file into database
Date: 2004-08-04 16:16:09
Message-ID: 1091636169.41110bc9b19f7@webmail.floog.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Oliver,

This time the copy command appeared to work, except for the "CFW" entry
in the integer-formatted column, but then trying to view the data shows
the long hyphenated line again and no readable data.

What do you think is causing this?
Thank you very much hanging in there with me on this issue.

Mike

TEST_DB=# copy matters (client_1_lastname, client_1_firstname,

<<<snip>>

TEST_DB(# case_type, billing_type, date_of_loss, judicial_district,
date_open,
TEST_DB(# date_close) from '/usr/local/postgres/TEST_DB.csv' DELIMITER
',';

ERROR: invalid input syntax for integer: ""CFW""
CONTEXT: COPY matters, line 1, column matter_num: ""CFW""

TEST_DB=# select * from matters;
client_1_lastname | client_1_firstname | client_1_address |
client_1_phone | client_2_lastname | client_2_firstname |

<<<snip>>>

-------------------+--------------------+------------------+
----------------+-------------------+--------------------+--
----------------+----------------+--------------+-----------+
-----------+-------------+-------------+--------+------------
+------------+-----------+--------------------+--------------
-------+--------------------+---------------------+----------
----------+---------------------+----------------------+-----
------------------+-----------+--------------+--------------+
-------------------+-----------+------------
(0 rows)

TEST_DB=#

Quoting Oliver Elphick <olly(at)lfix(dot)co(dot)uk>:

> You had a previous line without a terminating semi-colon. Notice
> that
> the prompt (TEST_DB-# rather than TEST_DB=#) indicates that this is
> a
> continuation line.
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message michael 2004-08-04 16:21:12 Re: help with COPY from .csv file into database
Previous Message Oliver Elphick 2004-08-04 15:57:27 Re: help with COPY from .csv file into database