Reputation: 63
I have a csv file I am trying to load into PostgreSQL, but it has about 200 columns. In Oracle or SQL Server, the import can pull the column headers from the CSV file directly without me having to create the table and define the fields first.
Is there a way to do this in Postgre or am I stuck having to create the table with all columns already defined?
Upvotes: 0
Views: 418
Reputation: 923
It is not possible to create table from csv . But what you can do is write a script to create table from the csv and then use \COPY command.
Upvotes: 3