How to Create Table from CSV
От | ray |
---|---|
Тема | How to Create Table from CSV |
Дата | |
Msg-id | b1361c5a-d8a5-4eb7-a284-20c5e52a0e26@j35g2000prb.googlegroups.com обсуждение исходный текст |
Ответы |
Re: How to Create Table from CSV
Re: How to Create Table from CSV Re: How to Create Table from CSV |
Список | 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 по дате отправления: