Re: help with COPY from .csv file into database

From: michael(at)floog(dot)net
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: help with COPY from .csv file into database
Date: 2004-08-04 14:40:03
Message-ID: 1091630403.4110f543d4ea6@webmail.floog.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have tried to COPY the contents of the .csv file into my database
called TEST_DB, but I'm still doing something incorrectly. Currently,
database TEST_DB has one table called "matters".

In my attempts listed below, I specified the name of each column/field
in my database and specified the delimiter used in the .csv file, but
still no go:

TEST_DB-# copy matters (client_1_lastname, client_1_firstname,
client_1_address, client_1_phone, client_2_lastname,
client_2_firstname, client_2_address, client_2_phone, carrier_name,
claim_rep, claim_num, responsible, supervisory, second, client_num,
matter_num, file_name, adverse_1_lastname, adverse_1_firstname,
adverse_2_lastname, adverse_2_firstname, adverse_3_lastname,
adverse_3_firstname, other_party_lastname, other_party_firstname,
case_type, billing_type, date_of_loss, judicial_district, date_open,
date_close) from '/home/floog/TEST_DB.csv' DELIMITER ',';

ERROR: syntax error at or near "client_1_lastname" at character 2

TEST_DB=# copy matters client_1_lastname, client_1_firstname,
client_1_address, client_1_phone, client_2_lastname,
client_2_firstname, client_2_address, client_2_phone, carrier_name,
claim_rep, claim_num, responsible, supervisory, second, client_num,
matter_num, file_name, adverse_1_lastname, adverse_1_firstname,
adverse_2_lastname, adverse_2_firstname, adverse_3_lastname,
adverse_3_firstname, other_party_lastname, other_party_firstname,
case_type, billing_type, date_of_loss, judicial_district, date_open,
date_close from '/home/floog/TEST_DB.csv' DELIMITER ',';

ERROR: syntax error at or near "client_1_lastname" at character 14

What did I do incorrectly?
Thank you for your time and assistance.

Mike

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message michael 2004-08-04 15:29:14 Re: help with COPY from .csv file into database
Previous Message Oliver Fromme 2004-08-04 09:54:16 Re: Performance Bottleneck