Re: help with COPY from .csv file into database - Mailing list pgsql-novice

From michael@floog.net
Subject Re: help with COPY from .csv file into database
Date
Msg-id 1091636169.41110bc9b19f7@webmail.floog.net
Whole thread Raw
In response to Re: help with COPY from .csv file into database  (Oliver Elphick <olly@lfix.co.uk>)
Responses Re: help with COPY from .csv file into database
List 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@lfix.co.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.
>




pgsql-novice by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: help with COPY from .csv file into database
Next
From: michael@floog.net
Date:
Subject: Re: help with COPY from .csv file into database