I have a csv file with 19 columns. How can I import the file to PostgreSQL without first creating a table and writing every column down? Thanks!
-
1You can't. A table needs to exist with the correct columns before you can import the CSV.Adrian Klaver– Adrian Klaver2022-01-28 20:42:05 +00:00Commented Jan 28, 2022 at 20:42
-
you can do it using csvsql, it will create the table and import data, take a look at : stackoverflow.com/questions/21018256/…mshabou– mshabou2022-01-28 20:55:47 +00:00Commented Jan 28, 2022 at 20:55
-
How people handle .csv file with 30+ or even more columns then. I know this can be done in Bigquery but I cannot save and download queries as a sql file. How about MySQL?Jade Young– Jade Young2022-01-28 20:59:17 +00:00Commented Jan 28, 2022 at 20:59
-
A SQL database is table based and you need one to exist to import data into. Now there are tools that will help you with this, but in the end they do the same thing create a table then import the data.Adrian Klaver– Adrian Klaver2022-01-28 21:19:18 +00:00Commented Jan 28, 2022 at 21:19
Add a comment
|