You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to use "copy" to copy data from a csv file to a table.
The postgresql-simple docs do not mention copying from/to a file though. (only stdin)
I tried it nevertheless, and it actually works (all data is loaded into the table), but the copy function gives me an error: QueryError {qeMessage = "Database.PostgreSQL.Simple.Copy.copy_ CommandOk", [...]
Is it just not intended to load directly from files or is there another way?
The text was updated successfully, but these errors were encountered:
PG.copy_ c "COPY table_name (col_1, col_2, col_n) FROM '/path/to/file.csv' WITH (format 'csv', QUOTE '"', DELIMITER '|', escape '\', ENCODING 'UTF-8' );"
That's because I didn't think it was necessary to read the file first, since I don't need it for anything other than dumping it to the database.
I would also load csv files up to 10GB in size and thought it might be faster to let Postgres handle that.
I wanted to use "copy" to copy data from a csv file to a table.
The postgresql-simple docs do not mention copying from/to a file though. (only stdin)
I tried it nevertheless, and it actually works (all data is loaded into the table), but the copy function gives me an error:
QueryError {qeMessage = "Database.PostgreSQL.Simple.Copy.copy_ CommandOk", [...]
Is it just not intended to load directly from files or is there another way?
The text was updated successfully, but these errors were encountered: