I agree, you want to use COPY FROM stdin. This closed PR https://github.com/invenia/LibPQ.jl/pull/172 contains some examples. When providing a CSV, be sure to quote the fields accordingly.
Doesn’t work it says “tablename must only contain alphanumeric characters and underscores” which is not true for Postgres Tables
After fixing that function I get an error say the table doesn’t exist. I was looking for something that would create the table for me if it doesn’t exist. I guess i have to write some code now.
The CSV upload does not create a table, you need to do this beforehand.
Usually, for a “persistent” database like Postgres you have a fixed schema which you use to create your tables and you populate your data afterwards. Thus creating a new table at the same time as filling it is not a very common use case.
Just for context; ODBC.jl doesn’t automatically create a table for you since it’s just a “middleware” and there isn’t a mechanism in the ODBC spec to generically create a table in any supporting database.