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 1091630403.4110f543d4ea6@webmail.floog.net
Whole thread Raw
In response to Re: Performance Bottleneck  (Oliver Fromme <olli@lurza.secnetix.de>)
Responses Re: help with COPY from .csv file into database
Re: help with COPY from .csv file into database
List 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



pgsql-novice by date:

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