How to Create Table from CSV - Mailing list pgsql-general

From ray
Subject How to Create Table from CSV
Date
Msg-id b1361c5a-d8a5-4eb7-a284-20c5e52a0e26@j35g2000prb.googlegroups.com
Whole thread Raw
Responses Re: How to Create Table from CSV  (Vibhor Kumar <vibhor.kumar@enterprisedb.com>)
Re: How to Create Table from CSV  (Rich Shepard <rshepard@appl-ecosys.com>)
Re: How to Create Table from CSV  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-general
I would like to create a table from a CSV file (the first line is
headers which I want to use as column names) saved from Excel.  I have
a new database which I have been able to create tables from a
tutorial.  But I haven’t been able to produce this new table.  The
following are my attempts:

CREATE TABLE Equpment_List_Sheet2 FROM 'Equipment List, reference
r1_Sheet2.csv' WITH DELIMITER ',' NULL '' CSV HEADER;
ERROR:  syntax error at or near "FROM"
LINE 1: CREATE TABLE Equpment_List_Sheet2 FROM 'Equipment List,
refe...

^
********** Error **********
ERROR: syntax error at or near "FROM"
SQL state: 42601
Character: 35
____________
copy TABLE Equpment_List_Sheet2 FROM 'Equipment List, reference
r1_Sheet2.csv' WITH DELIMITER ',' NULL '' CSV HEADER;
ERROR:  syntax error at or near "TABLE"
LINE 1: copy TABLE Equpment_List_Sheet2 FROM 'Equipment List,
refere...
                    ^
********** Error **********
ERROR: syntax error at or near "TABLE"
SQL state: 42601
Character: 6
______________
copy Equpment_List_Sheet2 FROM 'Equipment List, reference
r1_Sheet2.csv' WITH DELIMITER ',' NULL '' CSV HEADER;
ERROR:  relation "equpment_list_sheet2" does not exist
********** Error **********
ERROR: relation "equpment_list_sheet2" does not exist
SQL state: 42P01
_______________

Thanks for any help,
ray

pgsql-general by date:

Previous
From: Jon Nelson
Date:
Subject: regarding ROW comparisons
Next
From: Vibhor Kumar
Date:
Subject: Re: How to Create Table from CSV