0

Is there a way to create a table in Postgres by reading in a CSV and using the headers as column headers?

The only thing I've come across is copying table contents but that is only after you create the table.

IamWarmduscher
  • 875
  • 2
  • 10
  • 27
  • CSVs do not usually have column specifications, so how do you expect Postgres to infer the table creation instructions? – David Apr 06 '20 at 19:42
  • 1
    Does this answer your question? [Can I automatically create a table in PostgreSQL from a csv file with headers?](https://stackoverflow.com/questions/21018256/can-i-automatically-create-a-table-in-postgresql-from-a-csv-file-with-headers) – David Apr 06 '20 at 19:45

0 Answers0